Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Changing from full name to last, first mid

by fletcher_the_dog (Friar)
on May 24, 2004 at 21:14 UTC ( #356049=note: print w/replies, xml ) Need Help??


in reply to Changing from full name to last, first mid

From the command line you could just do:
perl -p -i -e 's/^(.*?)\s*(\w+)\s*$/$2, $1\n/' list.txt
Update This is making the assumption that the names are on different lines, if they are on the same line then you are going to have a very hard time determining where one name ends an another begins

Replies are listed 'Best First'.
Re: Re: Changing from full name to last, first mid
by jillern (Initiate) on May 25, 2004 at 03:47 UTC
    The s/ code did it...I guess I need to look more at regular expressions...thank you gde
      With your help I created my first "useful" perl program...I'm so happy. I have found inter peace. gde

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://356049]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2021-09-27 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?