3
votes
2answers
2k views

Unix command to get number of lines in a CSV file

I have to get the count of lines from incoming CSV files. I have used the following command to get the count. wc -l filename.csv Consider files coming with 1 record I am getting some files with * ...
1
vote
4answers
703 views

How to split CSV files as per number of rows specified?

I've CSV file (around 10,000 rows ; each row having 300 columns) stored on LINUX server. I want to break this CSV file into 500 CSV files of 20 records each. (Each having same CSV header as present in ...
0
votes
3answers
1k views

Unix - Surround First Column of CSV with double quotes

I have data in the following format - 4,"abc" 8,"def" 9,"ghi" I want to surround the value of the first column by double quotes. "4","abc" "8","def" "9","ghi" How do I do that ?
0
votes
1answer
33 views

Unix - Convert Column to CSV

I have the following output from a command in Unix - "10" "30" "u" "hello" And I want it in the following CSV format without the trailing comma - "10","30","u","hello" I tried tr '\n' ',' ...
1
vote
2answers
94 views

Unix copy multiple folders based on a specified CSV list using rsync

I have done some research and it appears that rsync is the only method that can possibly help me achieve this. I want to specify a list of folders in a CSV which can tell rsync to copy them to ...
3
votes
3answers
1k views

How to edit the header of a huge CSV file in-place?

I have several huge CSV files in which I want to swap two column names. I do not want to modify/copy/rewrite the data. The operation is very cheap in C: fopen the file, fgets the header, fseek or ...
7
votes
4answers
4k views

Sorting numerically in a comma-delimited file with Unix

I've got a comma-separated file that looks like this: 100,00869184 6492,8361 1234,31 200,04071 I want to use sort to sort this file numerically by the first column only. Desired Result: ...
8
votes
4answers
6k views

Unix command-Line CSV viewer

Is there a convenient command-line csv viewer, possibly a unix tool or a mod of some tools (e.g. vim or python)? I find it easy to simply edit CSV files by writing it manually (since all you need to ...
3
votes
2answers
4k views

Convert XLS to CSV in Unix

Is there an easy to compile plain C XLS (Excel sheet(s)) to CSV (or other text delimited format) converter for Linux or the BSDs that doesn't rely on Perl and installing a bunch of module perl modules ...
7
votes
3answers
3k views

Transforming CSV file using sed

In order to be able to import some data into a certain tool, I have to transform a CSV file from this format "data","data","data data","data","123" into this format data;data;data data;data;123 ...