I have a file with 65 sets of 35 coordinates, and would like to isolate these coordinates so that I can easily copy the coordinates to another file. The problem is, I've got a 9 line header before each set of coordinates (so each set is 44 lines long). There are a zillion threads out there about deleting whole lines out of a file, so I figured I would give one of those a shot. First I split the big file into a bunch of little ones using:
split -l 44 -d filename output
and then did what I thought would delete the first 9 lines of every file with output in the file name, combining everything back into one big file again:
more +10 output* > newfile
However, after I ran that I noticed that in newfile, only the first 9 lines of the first ouput file were deleted while every other file remained unchanged. Further, an additional header
:::::::::::::::
output00
:::::::::::::::
had been added on!
What am I doing wrong?
tl;dr how do you delete lines 1-9, 45-53, 89-97, etc in a file?
So I just want to make sure I follow this. You converted the numbering of lines to base 44 (that's what the NR % 44 was, I gather) so that you could delete any line with a ones place of 9 or under? What's the 0 {next} 1 bit, if you don't mind my asking?
Also, thanks very much for your help!