|
Posted by Jürgen Exner on June 18, 2008, 8:25 pm
Please log in for more thread options >Hi, I have a text file that contents a list of email addresses like
>this:
>
>"foo@yahoo.com"
>"tom@hotmail.com"
>"jerry@gmail.com"
>"tommy@apple.com"
>
>I like to
>
>1. Strip out the " characters and just leave the email addresses on
>each line.
'perldoc perlop' and look for either tr/// in combination with the 'd'
option or s/// in combination with the 'g' option. Maybe in combination
with anchoring the RE.
Or you can use substr() to grab anything between the first and last
character, excluding both.
>2. extract out the hotmail addresses
perldoc -f grep
>and store it into another file.
perldoc -f open
>The hotmail addresses in the original file would be deleted.
perldoc -q "delete a line"
jue
|