SPUG: perl one-liner help

Tim Maher tim at consultix-inc.com
Sun Apr 8 11:12:45 PDT 2007


On Wed, Apr 04, 2007 at 03:08:47PM -0700, Duane Blanchard wrote:
> Hi,
> 
> This should be the simplest thing, but I'm not able to get it.
> I have a list of names in a file separated by a semicolon and a space:
> Starr, Ringo; McCartney, Paul; Lennon, John; Harrison, George;
> and I want to substitute each /; / with a /\n/.
> I'm running WinXP.
> 
> perl -e "s/; /\n/" desktop/list.txt
> Thanks for any tips.
> Thx,
> D
> Duane Blanchard

FYI, I'm giving a talk entitled "Harnessing the Power of Perl's One-Liners"
at LinuxFest Northwest, up in Bellingham from 4/27-28. See lfnw.org
for details.

*-------------------------------------------------------------------*
|  Tim Maher, PhD  (206) 781-UNIX   http://www.consultix-inc.com    |
|  tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com    |
| CLASSES: 4/23: Perl+CGI; 5/7: Basic UNIX/Linux; 5/11: Perl Hashes |
*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
| >> My "Minimal Perl" is an Amazon Best Seller; 5 star rating! <<  |
| # Download chapters, read reviews, and order at MinimalPerl.com # |
*-------------------------------------------------------------------*


More information about the spug-list mailing list