By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,773 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,773 IT Pros & Developers. It's quick & easy.

command that can use to acess a line from a file in unix

P: 2
i wt a command that can use to acess a line from a file in unix
Oct 22 '07 #1
Share this Question
Share on Google+
6 Replies

MarkoKlacar
Expert 100+
P: 296
Hi,

you want to read just one specific line from a file, right?
Not quite sure I understood you...

Cheers
Oct 22 '07 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
i wt a command that can use to acess a line from a file in unix
First, you really need to be more specific and descriptive about what you are wanting. Second, please do not use SMS texting shorthand in the forums if you can help it. We are not limited to any number of characters like SMS is and in doing so, you make your posts more difficult to read and understand.

Regards,

Jeff
Oct 22 '07 #3

P: 2
Hi


Yes , I want to read just one specific line from a file.
Oct 23 '07 #4

Colloid Snake
100+
P: 144
Hi


Yes , I want to read just one specific line from a file.
Have you decided if you are using a shell script, awk, sed, some other language (python, perl, c++, java, etc...)?

As a shell script I believe you can load all the lines of a file into an array or some other container, but it would probably be easiest to Google something like "shell scripting file io" to figure it out.
Oct 23 '07 #5

pbmods
Expert 5K+
P: 5,821
Changed thread title to better describe the problem (threads whose titles do not follow the Posting Guidelines actually get fewer responses).
Oct 23 '07 #6

Expert 100+
P: 511
i wt a command that can use to acess a line from a file in unix
if you know the line contains some strings you want to find , you can use grep/sed/awk etc for that.
if you know the line number,
Expand|Select|Wrap|Line Numbers
  1. awk 'NR==5{print}' file
  2.  
Oct 24 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.