Answer the question
In order to leave comments, you need to log in
How to delete a column (columns) by their location (number) in a csv file?
There is a csv file with 12 fields, not commas but a semicolon as separators. There was a task to delete 2-3 and from 5-10th columns. Googled the solution cut -d, -f2-3 --complement out.csv > edited.csv; But in it, by default, the breakdown is by commas and not by semicolons. What can you advise? Is there a simple and short terminal command in bash that removes the required columns?
Answer the question
In order to leave comments, you need to log in
Thanks everyone, I found the solution
cut -d ';' -f 2-3.5-10 in.csv > out.csv;
The first link on request "cut custom delimiter" -
https ://unix.stackexchange.com/questions/556891/ca...
return back.
info textutils
man sed
man awk
man perl
You can assemble the necessary command from elementary bricks... No one will tell you a ready-made solution right away, because the data structure is not visible. But you can do everything) I translated the command from the syntax of the cat to the syntax of the jun)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question