Split file into multiple files based on number of records (or size)

70 views
Skip to first unread message

Íñigo Redín

unread,
Oct 28, 2015, 1:49:56 PM10/28/15
to csvfix
Hi all!

I'm new here.

Do you know if there is a way to split a file, but based on number of records?


I see there is a split_file command, but it is based on the content of some columns.



Thanks!

Neil Butterworth

unread,
Oct 28, 2015, 1:55:06 PM10/28/15
to csvfix
You can add the number of  fields to each CSV record using:

        csvfix eval -e '$fields' yourfile.csv > counted.csv

and then use split_file on the resulting counted.csv output file.
Reply all
Reply to author
Forward
0 new messages