Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reversing this awk script...

Status
Not open for further replies.

segment

ISP
Jun 15, 2004
225
US
I've got a question if someone would be so kind to help. Currently I have a script that turns the following address label into a single line:

Joe Shmoe
55 Main Street
Beverly Hills 90210

BEGIN {
FS="\n"
RS=""
}
{
print $1 ", " $2 ", " $3
}

Joe Shmoe, 55 Main Street, Beverly Hills 90210

Anyone have a reverse to take Joe Shmoe, 55 Main Street, Beverly Hills 90210 and turn it back into:

Joe Shmoe
55 Main Street
Beverly Hills 90210
 
A starting point:
BEGIN {FS=", ";OFS="\n"}
{print $1,$2,$3,""}

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top