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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting into a new file

Status
Not open for further replies.

meghardy

Technical User
Mar 12, 2003
3
GB
Hi there,

I am new to AWK and trying to do the following without success! If you can help, that would be great!

I have a file from which i want to extract into a new file, all the lines which have an N in the second column. The file is delimited by "|".

Any ideas?

Thanks
Meg
 
No! I am 25 years old! Its a problem with client data which i am trying to sort out. A suggestion was made to use awk, unfortunately, i've only used it a little. Do you have any suggestions on how to do this?

Thanks again
Meg
 
Sure...
[tt]
awk -F\| '$2=="N" {print $0}' file1 > file2
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top