Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

removing extra fields

Question posted by: ajd335 (Member) on May 9th, 2008 07:44 PM
Hi..
I have the below result in my one text file.


|-------------------|-
|email |
|-------------------|--
| |
| |
| |
| |
| Join Bytes! |
| email |
| |
| |
| |
| |
| Join Bytes! |
| Join Bytes! |
| Join Bytes! |
| Join Bytes! |
| Join Bytes! |
----------------------------------






is the table..that is in one text file..
I just want to have all the email address..

Code: ( text )
  1. sed -n "/com/p"  result.txt > result.csv


and it gives me

| abc @yahoo.com|
| Join Bytes!|

something like this..
m missing something to avoid that extra |..
Code: ( text )
  1. sed -e 's/|/ /g' result.csv > finalmail.txt


is working for both and gives final result.I want to combine both..
Thanks
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Ganon11's Avatar
Ganon11
Moderator
3,238 Posts
May 10th, 2008
02:03 AM
#2

Re: removing extra fields
Maybe a regular expression along the lines of:

Code: ( text )
  1. $line_of_text =~ /(\w+\@\w+\.\w+)/;

Reply
Reply
Not the answer you were looking for? Post your question . . .
178,098 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Perl Forum Contributors