in reply to sorting inside specific
UPDATE: Got rid of errors to occur when run with use strict and use warningsopen(IN, "<sort.in") || die "\nFailed to open infile $?\n"; open(OUT,">sort.out"); my @array; while(<IN>) { if (/<SEP>/) { print OUT join '',sort {$a <=> $b} @array; print OUT "<SEP>\n"; @array=(); } else { @array = (@array,$_); } } print OUT join '',sort {$a <=> $b} @array; close OUT; close IN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorting inside specific
by Limbic~Region (Chancellor) on Sep 10, 2004 at 13:37 UTC | |
by mutated (Monk) on Sep 10, 2004 at 13:49 UTC | |
by Limbic~Region (Chancellor) on Sep 10, 2004 at 13:52 UTC | |
by mutated (Monk) on Sep 10, 2004 at 14:00 UTC | |
|
Re^2: sorting inside specific
by jryan (Vicar) on Sep 10, 2004 at 19:37 UTC |