I have a CSV that is 40 000 lines long what is the simplest tool to read from line x to line y. I am sure there are more professional ways to do it but I would just like a bash script that works in the form of readFile --from 10 --to 20 so that I can process ten lines call it again and bring in ten more lines. I was considering just using an AWK script but can you do it even more simply with something like cat grep tail or head?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|||||
|
|
Extracting lines 10 to 20 of a file is a simple combination of
This command skips 10 lines and processes the next 10. If you want to process all the lines in the file in sequence, but by groups of 10, there are better ways. You can read 10 lines with
Alternatively, you can make awk do the job. Again, untested.
|
|||
|
|