in reply to Re^13: How do I use grep in a script
in thread How do I use grep in a script
Are the account numbers unique such that you can build a mapping of account number => name ?
my %name = (); . . while (<$fh>){ next unless /\S/; # skip blank lines if (/Acct:(\d+)/){ $acct = $1; } if (/Name:([^\s]+)/){ $name{$acct} = $1; } push @{$data{$acct}},$_ if ($acct); }
pojmy $outfile = join '_',$name{$acct},$acct,'2017.txt';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^15: How do I use grep in a script
by Flintlock (Novice) on Dec 28, 2017 at 16:06 UTC | |
by poj (Abbot) on Dec 28, 2017 at 16:17 UTC | |
by Flintlock (Novice) on Dec 28, 2017 at 16:34 UTC | |
by Flintlock (Novice) on Dec 29, 2017 at 14:40 UTC | |
by poj (Abbot) on Dec 29, 2017 at 15:08 UTC | |
|