linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (Q)gawk sorting
@ 2002-06-02 19:34 David Jackson
  0 siblings, 0 replies; only message in thread
From: David Jackson @ 2002-06-02 19:34 UTC (permalink / raw)
  To: Linux-Admin

Howdy --
I could use a little help with gawk sort function.

Thanks in advance,
David


Here's an example record:


Axtral 
130 Dartmouth St. Suite 415
boston, Massachusetts   02116

Here's what I'm looking for as far as output:

-------- Massachusetts --

Axtral 
130 Dartmouth St. Suite 415
boston, Massachusetts   02116

.......
........


---- Colorado ----

......
......
......


Here is the gawk script so far:


#!/usr/bin/gawk -f
BEGIN {
FS="\n"
RS="\n\n"
OFS="\n"
}
{
split($3,CityState,",")
print $1,$2,CityState[1]", " CityState[2],$4,$5
}



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-02 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-02 19:34 (Q)gawk sorting David Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).