[Novalug] Need sort script
Rich Goodwin
Rich.Goodwin@cox.net
Sun Dec 5 17:17:19 EST 2010
Don't write awk scripts? If it
1) Does the job,
2) The language you are most comfortable with and
3) Works across most *ix systems and other OS's,
Why would you NOT do it? 2 is the key driver ....
Rich
(a guy who, in 1984, wrote a checkbook tool on an AT&T 6300 Sys 5 based
system in ..... awk)
On Sun, 2010-12-05 at 11:43 -0500, James Ewing Cottrell 3rd wrote:
> On 12/2/2010 5:02 PM, Jon LaBadie wrote:
> > On Thu, Dec 02, 2010 at 01:48:14PM -0700, geoffm@companionway.net wrote:
> >> Just for grins I wrote an awk code snippet which I *think* does this as
> >> well:
> >> awk 'BEGIN{RS="GO"}
> Did you mean Perl? Don't write awk scripts!
> >>
> >> {
> >> data[$RN]=$0;
> > data[NR]=$0; # did you mean NR?
> >
> >> }
> >> END {
> >> n=asort(data);
> >> for(i=1;i<=n;i++)
> >> {
> >> print data[i];
> >> }
> >> }' myfile.sql
> >>
> >> Double - triple check me as my QA department is always out to lunch :)
> >> Geoff
>
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20101205/a5a4a1c0/attachment.htm>
More information about the Novalug
mailing list