For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > May 2005 > Trying to extract text from one file and put it in another.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trying to extract text from one file and put it in another.
scottf33

2005-05-18, 4:53 pm

Hello. I'm very new to Unix so I need some beginner help. I have a file which is full of discarded emails. Each email entry is preceded by the same header (Ex: From Machine A) and then the 'To:' line and the 'Subject' line are listed on separate lines. I want to go through the file and pull out the 'To' line and the 'Subject' line for each entry and write the results to another file. I have been playing with sed, awk, and grep but can't quite get this to work. Any help would be greatly appreciated.

Thanks,
Scott
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com