removing extra fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajd335
    New Member
    • Apr 2008
    • 123

    removing extra fields

    Hi..
    I have the below result in my one text file.


    |-------------------|-
    |email |
    |-------------------|--
    | |
    | |
    | |
    | |
    | abc@yahoo.com |
    | email |
    | |
    | |
    | |
    | |
    | abc@gmail.com |
    | ajan@yahoo.com |
    | ha@gmail.com |
    | abcd@rediff.com |
    | web@wemastre.co m |
    ----------------------------------






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

    Code:
      
          sed -n "/com/p"  result.txt > result.csv
    and it gives me

    | abc @yahoo.com|
    | bbb@gmail.com|

    something like this..
    m missing something to avoid that extra |..
    Code:
    sed -e 's/|/ /g' result.csv > finalmail.txt
    is working for both and gives final result.I want to combine both..
    Thanks
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Maybe a regular expression along the lines of:

    [CODE=perl]$line_of_text =~ /(\w+\@\w+\.\w+)/;[/CODE]

    Comment

    Working...