akrrs7 has asked for the wisdom of the Perl Monks concerning the following question:
However, I am clueless how to ensure that G is the first character and to return the value after the equal sign. Thanksmy $logFile = "someFile.log"; my $stringToFind = "Generated filename"; open logFile, $logFile or die $!; my @list = grep /\b$stringToFind\b/, <logFile>; chomp @list; print "$_\n" foreach @list;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need to search for a string in a file
by Utilitarian (Vicar) on Oct 20, 2011 at 10:43 UTC | |
by jwkrahn (Abbot) on Oct 20, 2011 at 20:38 UTC | |
by akrrs7 (Acolyte) on Oct 20, 2011 at 11:51 UTC | |
by aartist (Pilgrim) on Oct 20, 2011 at 14:19 UTC | |
by anneli (Pilgrim) on Oct 20, 2011 at 21:25 UTC | |
by aaron_baugher (Curate) on Oct 20, 2011 at 22:29 UTC | |
by anneli (Pilgrim) on Oct 20, 2011 at 23:07 UTC | |
by aaron_baugher (Curate) on Oct 21, 2011 at 18:36 UTC | |
|
Re: Need to search for a string in a file
by moritz (Cardinal) on Oct 20, 2011 at 10:27 UTC | |
|
Re: Need to search for a string in a file
by Anonymous Monk on Oct 20, 2011 at 10:44 UTC |