0
I have a bunch of *.csv files that use headers. Right now the files have headers and the same number of lines of data. I need to erase the data in these files, so I figured I could just overwrite the header into the files. I have file A set up properly with the header. How can I cat A into all the other csv files?
Alternatively, how could I delete the last X number of lines from the files? The path for the files is */*.csv
To delete the last X lines I found it easiest to use
sedwhere<N>is the first line you want to delete and$is used to specify the last line:sed -i '<N>,$d'. For example, to delete from the 2nd line to the end:sed -i '2,$d'. – Stuart – 2014-10-06T17:58:22.520