From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David Jackson" Subject: (Q)gawk sorting Date: Sun, 2 Jun 2002 13:34:36 -0600 Sender: linux-admin-owner@vger.kernel.org Message-ID: <200206021334.AA723124504@wcox.com> Reply-To: Mime-Version: 1.0 Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 }