in reply to
Re^6: raw data formatting
in thread raw data formatting
A grep on the data to check for four spaces followed by a digit at the beginning of each line works:
use strict;
use warnings;
use List::MoreUtils qw/natatime/;
my $it = natatime 5, grep /\A\s{4}\d/, <DATA>;
while ( chomp( my @lines = $it->() ) ) {
my $letter = 'A';
my $acctNum = do { $lines[0] =~ /\s+(\d+)\s+(\d+)/; $1 . $2 };
push @lines, " acctnum=$acctNum";
print for map { s/\s+/$letter++ . ' '/e; "$_\n" } @lines;
}
__DATA__
Place your data here...