CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [mrsaqib] Extract email from txt file: Edit Log



ichi
User

Oct 12, 2009, 6:57 PM


Views: 2571
Re: [mrsaqib] Extract email from txt file

what have you tried?

pseudocode:


Code
while  ( looping through file ){ 
check to see if line starts with "From" # hint: use regex ^ , or use index() ; see perldoc -f index
if ( it starts with "From" ) {
split the line on space # hint : perldoc -f split
get the second element of the array output by split()
print it out
exit
}

}


in short if you want to program in Perl, all you have to do is RTFM:
1) perldoc -f split
2) perldoc -f index
3) perldoc perlre


(This post was edited by ichi on Oct 12, 2009, 6:58 PM)


Edit Log:
Post edited by ichi (User) on Oct 12, 2009, 6:58 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives