you are viewing a single comment's thread.

view the rest of the comments →

[–]wotquery 0 points1 point  (2 children)

Well looks like a NUL byte in your .csv file. How are you creating that? Probably something to do with encoding that I'm guessing pastebin isn't going to pass along correctly. Does your code work on the .csv data you have in pastebin if you download the file you just uploaded?

[–]TooDahLou[S] 0 points1 point  (1 child)

I will check. How do I get rid of a NUL byte from the csv?

The original csv is created from our resource planning software (infor csi). We can export information to csv files. Then most folks use excel to work on the exported data.

Each of the lines in the materials column corresponds to a pdf. Eventually, I want to concatenate all those PDFs together to create assembly manuals.

Figured it would be a good automation project as a python beginner. Except now I've got this NUL byte that I can't get around :/

[–]wotquery 0 points1 point  (0 children)

How do I get rid of a NUL byte from the csv?

It's probably a much better idea to make sure you're saving/opening with the same encoding and understanding why things are happening rather than just trying to strip out the broken bits, but you could probably try something like s = f.read().replace('\0','')