Tuesday, 13 August 2013

How do i copy every line X line from a bunch of files to another file?

How do i copy every line X line from a bunch of files to another file?

So my problem is as follows: I have a bunch of files and i need only the
information from a certain line in each of these files (the same line for
all files). Example: I want the content of the line 10 from file
example_1.dat~example_10.dat and then i want to save it on > test.dat
I tried using: head -n 5 example_*.dat > test.dat. But this gives me all
the information from the top till the line i have chosen instead of just
the line. Please help.

No comments:

Post a Comment