Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value of Line Number x 1

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello (again),

I have one more stumper today...

Using a bourne script, how can I get the value of an item at a particular line number in a text list file?

My File
Code:
apples
oranges
pears

How can I get the value of the contents of line 2?

Thanks,

Michael42
 
Code:
 # print line number 52
 sed -n '52p'                 # method 1
 sed '52!d'                   # method 2
 sed '52q;d'                  # method 3, efficient on large files

sed1liners

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
vgersh99,

That was perfect! :)


Thanks for posting,

Michael42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top