PERL array spacing
lines in:
4,355,384 20,762,557 16,407,173 TOTAL
14,470,261 27,190,250 12,719,989 TOTAL
18,825,645 47,952,807 29,127,162 TOTAL
PERL script:
open(TOTAL,"grepTOTAL /otl/ds_metric/data_files/modem_times|");
push(@total,<TOTAL>);
close(TOTAL);
$record = join(" ", @total);
$record =~ s/TOTAL//g;
@total2 = split (/\s{2,}/, $record);
print @total2;
gives me this result.
4,355,384 20,762,557 16,407,17314,470,261 27,190,250 12,719,98918,825,645 47,952,807 29,127,16
what im looking for is this:
4,355,384 20,762,557 16,407,173 14,470,261 27,190,250 12,719,989 18,825,645 47,952,807 29,127,162
Difference : there is a space where TOTAL used to be in the latter versioin of the output line.
Ive tried a few different ways to substitue the TOTAL word but everything comes back to having no space between the numbers
in between the TOTAL word (ex: 16,407,17314,470,261 27,190,250 is what i get 16,407,173 14,470,261 27,190,250 is what i want)
can anyone lend me an idea on how to get that space in there while still subbing that TOTAL out easily?
-jamison-