[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed/awk, instead of Perl
- To: Steve Bertrand <steve_(_at_)_ibctech_(_dot_)_ca>, freebsd-questions_(_at_)_freebsd_(_dot_)_org
- Subject: Re: sed/awk, instead of Perl
- From: Walt Pawley <walt_(_at_)_wump_(_dot_)_org>
- Date: Thu, 21 Aug 2008 15:51:41 -0700
- Cc:
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_(_dot_)_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_(_dot_)_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_(_at_)_\example_(_dot_)_com/' input_file > output_file
Sorry...
--
Walter M. Pawley <walt_(_at_)_wump_(_dot_)_org>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
541-672-8975
_______________________________________________
freebsd-questions_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe_(_at_)_freebsd_(_dot_)_org"
Visit your host, monkey.org