printing lines from file separated by |
This commit is contained in:
parent
0c61e4d061
commit
410b97cde5
@ -18,7 +18,13 @@ if (!defined $ARGV[0]) {
|
|||||||
|
|
||||||
my $infile = $ARGV[0];
|
my $infile = $ARGV[0];
|
||||||
open(DAT, $infile) or die "$infile: $!";
|
open(DAT, $infile) or die "$infile: $!";
|
||||||
print <DAT>;
|
my @cleaned = ();
|
||||||
|
foreach my $line (<DAT>) {
|
||||||
|
$line =~ s/\s*$//;
|
||||||
|
$cleaned[++$#cleaned] = $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
print join("|", @cleaned) . "\n";
|
||||||
|
|
||||||
close(DAT);
|
close(DAT);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user