Closed kiteloopdesign closed 2 months ago
No - that tool was requested here, but csvkit is not adding new tools: https://github.com/wireservice/csvkit/issues/1057
That said you can use e.g.
printf 'col1, col2, col3\nstr1, str2-remove, str3' | csvsql --query "SELECT col1, REPLACE(\" col2\", '-remove', '') AS \" col2\", \" col3\" FROM stdin"
The weird quoting is because your CSV for some reason has spaces at the start of each cell.
Thanks a lot for your quick reply and for the amazing toolset!
Btw, the unmaintained csvmedkit package has a "csvsed" command. I haven't tried it: https://pypi.org/project/csvmedkit/
I've reopened #1057 for consideration.
Hi, please allow me to ask a question although I do not think this is possible with the current set of csv utilities. Is it possible to parse some string column wise? For instance, this csv
csvparse -c 2 --regexp 's/str2-remove/str2/'
Thanks