Splitting a CSV file

I was a little reluctant to push out a change that would affect nearly 600 Access Points, so I wanted to do it in batches of 100. As the method of input was CSV, I needed to break this up.

The Split command from the GNU coreutils was the perfect solution for my needs.

split -l 100 list.csv –additional-suffix=.csv output/test -d

The output of that command produces the following files, each with 100 lines of data and places them inside the directory named output.


Without the –additional-suffice and -d options the files would not have the extension I was looking for, and it would have been ordered alphabetically instead of numerically.

Leave a Reply

Your email address will not be published. Required fields are marked *