in reply to Re^2: Combined lines from a file into one
in thread Combined lines from a file into one
#!/usr/bin/perl # http://perlmonks.org/?node_id=1137428 use strict; use warnings; open (my $rangeFixed, '<', "rangeFile.txt") or die "Cannot Open File: +rangeFile.txt $!"; $_ = join '', <$rangeFixed>; s/^(IMB,\d+,V1\s,)(\d+),\K (?:.*\n)+ \1\d+,(\d+).*/$3/gmx; open (my $rangeOutput, '>', "test.txt") or die "Cannot Open File: test +.txt: $!"; print $rangeOutput $_; close $rangeOutput;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 17:31 UTC | |
by poj (Abbot) on Aug 05, 2015 at 17:54 UTC | |
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 15:46 UTC | |
by poj (Abbot) on Aug 05, 2015 at 15:55 UTC | |
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 16:03 UTC | |
by poj (Abbot) on Aug 05, 2015 at 16:40 UTC | |
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 16:45 UTC | |
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 15:44 UTC | |
|
Re^4: Combined lines from a file into one
by emadmahou (Acolyte) on Aug 05, 2015 at 16:00 UTC |