sed/awk, instead of Perl

Walt Pawley walt at wump.org
Thu Aug 21 23:22:15 UTC 2008


At 4:19 PM -0700 8/21/08, Walt Pawley wrote:

>At 3:49 PM -0700 8/21/08, Walt Pawley wrote:
>
>>At 8:46 AM -0400 8/21/08, Steve Bertrand wrote:
>>
>>>- read email addresses from a file in the format:
>>>
>>>user.name TAB domain.tld
>>>
>>>- convert it to:
>>>
>>>user_name at example.com
>>>
>>>- write it back to either a new file, the original file, or to STDOUT
>>
>>I'm curious why Perl isn't a decent choice. I think I'd do something like
>>
>>perl -pe 's/(.*?)\.(.*)\t.*/$1_$2 at example.com/' input_file > output_file
>
>Which is also wrong. It gets a bit closer to Steve's desires I
>suspect if one adds the appropriate backslash ...
>
>perl -pe 's/(.*?)\.(.*)\t.*/$1_$2@\example.com/' input_file > output_file
>
>Sorry...

I guess getting old, nearly blind and mind numbing close to
brain dead is better than the alternative. Try this (sooner or
later I've got to get it right)...

perl -pe 's/(.*?)\.(.*)\t.*/$1_$2\@example.com/' input_file > output_file

Sorrier.
-- 

Walter M. Pawley <walt at wump.org>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
         541-672-8975


More information about the freebsd-questions mailing list