Closed poolfactory closed 3 years ago
please use double quotation marks for patterns containing any comma, e.g., -p '"A{2,}"'
For column Hi, there
, it can be
csvtk cut -f '"Hi, there"'
Or
csvtk cut -f "\"Hi, there\""
But on Windows, I tested and failed.
Besides, for your file, it would need a lot of manually typing. I'd like to suggest you to edit or rename the column names in a text editor or Excel.
Or you can use numeric indexes for selecting, before that, you may use csvtk headers to check the column names and their column numbers.
Hello shenwei365,
i have a CSV which has commas in some column names and I guess they are causing problems when using cut -f.
How could I escape a comma in a column name like this:
cut -f "Hi, there"
csvtk 0.23.0 on Windows. Delimiter is ,
Real life example: The following command fails with "System could not find the indicated file"
csvtk cut "source.csv" -f ID,Typ,Artikelnummer,Name,Veröffentlicht,"Ist hervorgehoben?","Sichtbarkeit im Katalog","Datum, an dem Angebotspreis beginnt","Datum, an dem Angebotspreis endet","Vorrätig?","Gewicht (kg)",Angebotspreis,"Regulärer Preis","Übergeordnetes Produkt" -C "" -I -o "destination.csv"
Thank you for advice. Great piece of software!