#!/usr/bin/perl my $MaxLineLength = 8060; $search = '<COLUMNS>'; $replace = '<DATA>'; $searchEnd = '</COLUMNS>'; $replaceEnd = '</DATA>'; $fileContents = ''; my $linePrefix = ''; while (<STDIN>) { chomp; # Remove newline if (/(^<DATA>\t).*(<\/DATA>$)/) { next if length() > $MaxLineLength; } elsif (/(^<COLUMNS>\t).*(<\/COLUMNS>$)/) { s/$search/$replace/g; s/$searchEnd/$replaceEnd/g; } else { next; } print $linePrefix; # Empty only for first line print; $linePrefix = "\n"; }
In reply to Re^2: Newline Problem
by ikegami
in thread Newline Problem
by doublek321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |