Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, September 5, 2013

LINUX: Going to the specific line in the huge text file....



You can use sed for this:

sed -n '320123'p filename

This will print line number 320123.


If you want a range then you can do:

sed -n '320123,320150'p filename


If you want from a particular line to the very end then:

sed -n '320123,$'p filename

Tuesday, April 17, 2012

How to cut first n fields in the text file using awk

To cut first 4 columns of the text file just use:

  awk '{print substr($0, index($0,$4))}'