########################### # diesel1.pl # 07.08.23 use strict; my(%t,@fld); open(IN,"diesel.txt") or die "Can't open the file diesel.txt"; open(OUT,">diesel1.txt"); while(<IN>){ @fld = split; if ( /^\w/ && $#fld < 3 ) { print OUT 'NO1==>',$_; } elsif ( /^\w/ && $#fld >= 3 ) { print OUT 'NO3==>',$_; } elsif ( /^\t/ ) { } else { print OUT 'NO2==>',$_; } } close(OUT); close(IN);