I need to compare columns widths and data types in a txt file using a template. Here is a bit of code that I have been working on, just need some help doing the comparisons using unpack. - perlnewbe...
#!/usr/local/bin/perl
use strict;
use warnings;
my $foo = ();
my @bar = ();
$foo = "A3 A3 A2 A3 A2 A9 A2 A10 A11 A9 A1 A1 A1 A150 A2 A3 A4 A6 A6";
open FILE, ("c:/workspace/test files/ABC_DEF_GH111_B02_DGETBA_2010.TXT")or die;
while (<FILE>) {
(@bar) = unpack($foo);
print(@bar, "\n");
}
close (FILE);