in reply to How to restart a while loop that is iterating through each line of a file?
I am trying to take the first 16 lines of a single fileThere's a tool called head which does just that:
$ head -n 16 lines.txt > temp.lines.txt
and populate those same 16 lines in 34 different (but incrementally named) filesNow use a loop and copy the saved lines to the output files:
And remove the temp file:$ for i in $(seq 0 33); do cp temp.lines.txt "Annotation_output$i.vcf" +; done
$ rm temp.lines.txt
|
|---|