Hello all,
I'm having a problem with next unless - strange because it was working for me a few
weeks ago, it doesn't now and I can't figure out why.
I'm processing a text file in two steps because I don't know how to do that in one
step:
First step:
Getting rid
Oops. I forgot about the input file. Sorry.
Greg
edasnpb1.udf
> while () {
>
> if (/^FILEHEADER/) {
>#ignore
>} elsif (/^DOC HEADER(\d+)/) {
>s/(DOC HEADER)(3 )/:ASNLNT: /;
>print;
>
>} elsif (/^HEADER/) {
>chomp;
>@fields = split(/~/, $_,);
>print join('~', @fields, "\n");
while () {
chomp;
my @fields = split /~/;
>$upc = $fields[7];
>print join('~', @fields[0..6], sprintf("%-15s", join('',split(/
/,$upc))), @fields[8,9,10], $fields[4], "\n");
>
>next unless (/^EDI_ASN_D/);#it doesn't work for some reason
>
__
> while () {
Of course you'll have to change this...
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
$fields[1] = sprintf("%04s", $count_ecd);
$upc = $fields[7];
$fields[9] = $count_ea + $count_ead + $count_ec + $count_ecd;
#$count_item
print join('~', @fields[0..6], sprintf("%-15s", join('',spli
PROTECTED]]
>
>} elsif (/^EDI_CONT_D/) {
>chomp;
>@fields = split(/~/, $_,);
>$upc = $fields[7];
>print join('~', @fields[0..6], sprintf("%-15s", join('',split(/
/,$upc))), @fields[8,9,10], $fields[4], "\n");
>
ip everything up to the second
> EDI_ASN_D line, skip the first EDI_CONT/EDI_CONT_D segment,
> print the second EDI_CONT/EDI_CONT, go to the third EDI_ASN_D
> segment and print the third EDI_CONT/EDI_CONT_D segment, go
> to the fourth EDI_ASN_D segment and so long up to the end.