howto:linux_insert_header_in_all_files
This is an old revision of the document!
Insert the same header (file) in a number of files
The trick here is to use cat
and pipe to a tmp file which you then rename to something sensible.
for f in chr*txt; do echo $f; cat header.txt $f > tmp; mv tmp $(basename $f .txt).csv; done
Note that the above assumes the existence of the header in a file (header.txt
). Also this will rename each .txt
file to .csv
.
howto/linux_insert_header_in_all_files.1480673842.txt.gz · Last modified: 2018/10/09 10:12 (external edit)