I am trying to extract the text between two specific line numbers using
sed 'startLine,endLined' myFile.txt
But somehow it keeps extracting from the begining of the file to endLine.
What is wrong here?
You need to tell sed not to print all other lines but the ones you want.
sed -n '123,234p' myFile.txt
The -n tells sed do not print lines scanned.
the 123,234 define the range of lines you are interested in
the p is the command to print the line.
This way it will only print the lines that match what you told it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With