in reply to Parsing a csv file from Exchange
Here, I look for any sub-string in the field bounded with string 'SMTP' on the left and '%' character on the right. Option /g allows regular expression to pick successive occurances of a matched string (on every loop cycle). You could read more on this and many other features of Perl regular expressions here.# ... up to this point, # you must have read 1 line from the file ... # and (for sake of example) the email field saved in into $email_field + variable. my @emails; while ($email_field =~ m/SMTP:([^\%]+)\%/g) { # validate matched email first... (as per UPDATE) push @emails, $1; # add email address to the list } # @emails array now contains all SMTP email addresses # found in the field.
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+) +-.*)$/;$_=["ps -e -o pid | "," $2 | "," -v "," "]`@$_`?{print" ++ $1"}:{print"- $1"}&&`rm $1`;print"\n";}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 2Re: Parsing a csv file from Exchange
by jeffa (Bishop) on May 21, 2002 at 00:12 UTC | |
by cajun (Chaplain) on May 21, 2002 at 06:28 UTC |