in reply to Sorting and subsituting a data file, one pass
my %seen; while (<>) { if (s/\\\n\z/ /) { my $next = <>; if (defined($next)) { if ($next =~ /^\s*-end\s/) { $_ .= $next; } elsif ($next =~ /(\\\n)\z/) { $_ .= "\\\n"; } else { $_ .= "\n"; } redo; } } print if /^data\s/ && !$seen{$_}++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting and subsituting a data file, one pass
by tsk1979 (Scribe) on Jun 21, 2010 at 09:38 UTC | |
by Anonymous Monk on Jun 21, 2010 at 10:42 UTC |