[Novalug] Need sort script
Geoff McNamara
geoffm at companionway.net
Sun Dec 5 19:08:22 EST 2010
<flame bait mode>
I *did* write this in PERL and submitted to the list first,
.... but knowing that PERL came from the merits of awk, sed, and grep
(because they exist on all *nix systems)
and most importantly .....
<raising flame to a new level>
knowing that if you fail to learn awk, sed, and grep - you are
doomed to having all you your PERL scripts re-written when you
leave you current work location....
</raising flame to a new level>
PERL is great but must be installed, maintained (meaning all needed
modules and libraries loaded), and must be supported by someone who has
the same "style" as the author...
My apologies ----- flame bait was taken, hooked, swallowed, and dragged
out of the water....
</flame bait mode>
Sorry for going off on a tangent ... (My mentors were all unix
fundamentalists [thank you to all of them] )
Enjoy.....
-g-
On 12/05/2010 11:43 AM, 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 at 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 at calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
More information about the Novalug
mailing list