in reply to Re^3: How to have perl check line length
in thread How to have perl check line length
Thanks again for the help.open(NPBXNUM1, ">npbxnum1"); open(MYINPUTFILE, "npbxnum"); while (<MYINPUTFILE>) { my($line) = $_; chomp($line); foreach my $inputData ($line) { my $outputData = $inputData; while (length($outputData) < 4) { $outputData .= '_'; } print NPBXNUM1 "$outputData\n"; } } close(MYINPUTFILE); close(NPBXNUM1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to have perl check line length
by marinersk (Priest) on Sep 18, 2013 at 02:04 UTC |