#!/usr/bin/perl my $target = '/tmp/filetest'; my @sources = <*pol.txt>;; die "Usage: $0 in in ... in out\n" if not @sources; open my $out, '>>', $target or die "Could not open '$target' for appen +ding\n"; foreach my $file (@sources) { if (open my $in, '<', $file) { while (my $line = <$in>) { `sed 's/\(.*\),/\1/'`; print $out $line; } close $in; } else { warn "Could not open '$file' for reading\n"; } } close $out; `sort /tmp/filetest -o /tmp/filetest`; #print "done\n";
In reply to sed command in perl by novice2015
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |