bash : read every line from text file starting at given line number
Hello,
I have a complicated parsing script. Say my parameter is line number 200. I know my file has more lines than the given parameter. head -c 200 filename would give me the first 200 which is not what I need. What I need is every line starting at line number 200. I was hoping not to have to nest yet another loop. TIA for all suggestions, Bert |
sed -n '200,$p' textfile should work.
Note that the $ needs to be escaped or enclosed in single-quotes, or else your shell will interpret $p as if it were a variable. |
Code:
tail -n+200 file |
Code:
awk 'NR>=200' file |
Thank you very much
All three solutions work perfectly on my system, I tip my hat to you.
Thank you very much. Cheers, Bert |
All times are GMT -5. The time now is 07:29 PM. |