linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Jackson" <david.jay.jackson@wcox.com>
To: Linux-Admin <linux-admin@vger.kernel.org>
Subject: (Q)gawk sorting
Date: Sun,  2 Jun 2002 13:34:36 -0600	[thread overview]
Message-ID: <200206021334.AA723124504@wcox.com> (raw)

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
}



                 reply	other threads:[~2002-06-02 19:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200206021334.AA723124504@wcox.com \
    --to=david.jay.jackson@wcox.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).