in reply to Re^7: How do I use grep in a script
in thread How do I use grep in a script
You can add the name onto the existing $acct variable
pojwhile (<$fh>){ next unless /\S/; # skip blank lines if (/Acct:(\d+)/){ $acct = $1; if (/Name:([^\s]+)/){ $acct = $1.'_'.$acct; } } push @{$data{$acct}},$_ if ($acct); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: How do I use grep in a script
by Flintlock (Novice) on Dec 27, 2017 at 17:34 UTC | |
by poj (Abbot) on Dec 27, 2017 at 17:37 UTC | |
by Flintlock (Novice) on Dec 27, 2017 at 17:49 UTC | |
by Flintlock (Novice) on Dec 27, 2017 at 18:12 UTC | |
by Flintlock (Novice) on Dec 28, 2017 at 15:49 UTC | |
|