Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Extract field from pipe delimited flat file

by Purdy (Hermit)
on Nov 16, 2001 at 22:25 UTC ( #125878=note: print w/replies, xml ) Need Help??


in reply to Extract field from pipe delimited flat file

Not sure if that previous example will work if your text file is all one line like it is in your example. I'd recommend using grep() (this is also untested code):

# this is a lazy regexp - you can refine it better, I'm sure. # $line is the line of text from your example @emails = grep ( /.*\@.*/, split( /\|/, $line ) );

Jason

update - before the sanitization of the data above, it was all in one line. No, really! ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://125878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2019-11-13 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (68 votes). Check out past polls.

    Notices?