Is there an application or a command that could to split a csv (preserving the a table header) into smaller equal parts?
I'm trying to import a large 36mb file and the importer is going kaputz.
Here's an example of a windows application: http://download.fyxm.net/CSV-Splitter-33994.html
I guess i could use wine to use this program but would prefer something native of ubuntu.
You can use csvfix.
It's a command line tool for managing CSV files. The download page doesn't have any Linux binaries, but you can compile the source code from a makefile.
Here is a list of commands. In particular, the
file_split
command looks to be what you're after.The manual for csvfix can be found here.
So you want to have multiple files which contain part of the entries in the main file and each contains the table header?
If that is what you want, one could write a simple script that takes the first file and the number of files that you want (or the number of lines in each file) and creates those files.
If it does not need to be graphical and you tell me what parameters you want to set, I can try to make such a script for you.
This is my quick and dirty solution:
I also made an online version that allows splitting by lines, file size, or file count. It's quite intuitive and user-friendly.
CSV Live Splitter
I made one because I wanted an online one I could use on my mac..
check this