Removing spaces from columns of a CSV file in bash
- by vikas ramnani
I have a CSV file in which every column contains unnecessary spaces(or tabs) after the actual value. I want to create a new CSV file removing all the spaces using bash.
For example
One line in input CSV file
value1 ;value2 ;value3 ;value4
same line in output csv file should be
value1;value2;value3;value4
I tried using awk to trim each column but it didnt work. Can anyone please help me on this ?
Thanks in advance :)