I've got this code to extract the first 5 lines of a bunch of semi-colon delimited text file and append the filename to the start of each line.
awk 'FNR==1,FNR==5 {printf("%s;%s\n",FILENAME,$0)}' *.csv > output.csv
Any suggestions how I get this to scan through sub-directories too to pick up files in there? Cheers
Any suggestions how I get this to scan through sub-directories too to pick up files in there?
Nope, but google might. You could probs adjust this
https://stackoverflow.com/questions/33049089/using-awk-to-read-and-create-files-in-all-subdirectories
@aggi started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
I've got this code to extract the first 5 lines of a bunch of semi-colon delimited text file and append the filename to the start of each line.
Any suggestions how I get this to scan through sub-directories too to pick up files in there? Cheers