larsyencken / csvdiff

Generate a diff between two tabular datasets expressed in CSV files.
BSD 3-Clause "New" or "Revised" License
132 stars 31 forks source link

(white)space in column name #10

Closed ariedeleen closed 8 years ago

ariedeleen commented 8 years ago

How to deal with a white space in the column name?

For example grocerylist.csv:

Product Part Number,Product Name,Amount In Stock 1,Banana,7 2,Apple,12 3,Raspberry,7 4,Mango,19 5,Potato,10

Now csvdiff breaks execution after Product because not finding Part

larsyencken commented 8 years ago

Hi Arie,

If you're using csvdiff on the command-line, then the most important thing to is to use quotes around the key field. For example, the following worked for me, when I used your example data:

csvdiff 'Product Part Number' example-a.csv example-b.csv

Does that solve your issue?

ariedeleen commented 8 years ago

Works like a charme Lars,

best regards Arie

larsyencken commented 8 years ago

Great! Happy data digging :)