A
asm_toronto
I have a datafile (over which I have no control) with a lot of leading
blank spaces
in certian records, which affects my alphabetic sorts.
Can someone help me make this routine ignore leading spaces?
open (DATA, "$DataDir/offline.txt");
my @aro = map { join '|', @$_ }
sort { lc($a->[1]) cmp lc($b->[1]) }
map { [ split /\|/ ] } <DATA>;
foreach $Ad (@aro) {
@Field = split (/\|/, $Ad);
if ($Field[0] ne "") {
$AdFile[$Count1] = $Ad;
$Count1++;
}
blank spaces
in certian records, which affects my alphabetic sorts.
Can someone help me make this routine ignore leading spaces?
open (DATA, "$DataDir/offline.txt");
my @aro = map { join '|', @$_ }
sort { lc($a->[1]) cmp lc($b->[1]) }
map { [ split /\|/ ] } <DATA>;
foreach $Ad (@aro) {
@Field = split (/\|/, $Ad);
if ($Field[0] ne "") {
$AdFile[$Count1] = $Ad;
$Count1++;
}