I have a CSV file that has 5 lines at the top of the file that I want to remove using node.js. I then want to add my own header line that better matches the header I would use. I have no control of the original csv file so unable to to do this at the source.
1 Answer
It will be easiest using one of the following modules:
or other that you find in:
(don't worry if it's CSV or TSV - just make sure that you use the correct delimiter which is comma in your case).
You might do it all manually parsing the file as text but using a module for that will be much less error prone.
(cat good-header.csv; tail -n +5 original-file.csv) > the-result.csv