I want to add a line of headers to an existing CSV file, edit it in place. How can I do this?
Echo, two, three '& gt; Testfile.csv
and I
column1, column2, column3 one, two, three
(NB is out of my hands by changing the initial CSV output) EDIT: I was originally using 'sed' but any standard command would have to be done. The important thing is that the file has been edited in place, and the file is inserted at the beginning of the file.
This adds custom text to the beginning of your file:
Dumb 'your_custom_escaped_content' & gt; Temp_file.csv cat testfile.csv & gt; & Gt; Temp_file.csv mv temp_file.csv testfile.csv
Comments
Post a Comment