------------------------------------------------ #!/usr/bin/perl my $MaxLineLength = 8060; $search = '<COLUMNS>'; $replace = '<DATA>'; $searchEnd = '</COLUMNS>'; $replaceEnd = '</DATA>'; $fileContents = ''; while (<STDIN>) { if (/(^<DATA>\t).*(<\/DATA>$)/) { if (length() <= $MaxLineLength) { print; } } elsif (/(^<COLUMNS>\t).*(<\/COLUMNS>$)/) { s/$search/$replace/g; s/$searchEnd/$replaceEnd/g; print; } }
In reply to Newline Problem by doublek321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |