I am trying to strip 2 strings from a file and then add select parts of them together, for some reason the output is being duplicated any ideas??
Here is some of the script I am using;
open (TMP, "c:/mysql/data/sbmtmp.txt" or die "Cannot open output.txt for read :$!";
while (<TMP>)
{
chomp;
if ($_ =~ /^Product Code :/)
{
($product_code,$prod_des) = unpack("x23 A10 x7 41", $_);
}
if ($_ =~ /PALLETS /)
{
$plt_qty = unpack("x78 A3", $_);
}
printf "$product_code, $prod_des, $product_code, plt_qty\n";
} Nogs
Here is some of the script I am using;
open (TMP, "c:/mysql/data/sbmtmp.txt" or die "Cannot open output.txt for read :$!";
while (<TMP>)
{
chomp;
if ($_ =~ /^Product Code :/)
{
($product_code,$prod_des) = unpack("x23 A10 x7 41", $_);
}
if ($_ =~ /PALLETS /)
{
$plt_qty = unpack("x78 A3", $_);
}
printf "$product_code, $prod_des, $product_code, plt_qty\n";
} Nogs