This is a discussion on pattern search with numbers within the Coding in General forums, part of the Development/Scripting category; This is the part which is responsible for giving me the result, but i have a small problem with this, ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
This is the part which is responsible for giving me the result, but i have a small problem with this, this jus gives me the number which is present after the search phrase not the number before that.
The perl program actually searches for a pattern and returns a number present after the pattern in the log file. My search phrase will be something like: total rows rejected: or rows rejected For example, Code:
total rows rejected: 4000 but if my search phrase is Code:
3000 rows rejected could somebody help in this? Code:
print qq{$1\n}
if ($lines[ $lineNo ] =~ m{\Q$Phrase\E\s*(\d*)});
Last edited by mercuryshipz; 02-14-2008 at 11:19 PM. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search Pattern And Arrays | mercuryshipz | Coding in General | 1 | 02-11-2008 02:26 PM |
| diff command to exclude files that match pattern | piggy | Getting started tutorials | 1 | 08-13-2007 10:52 PM |
| Help with numbers | ricc | Shell scripting | 3 | 12-16-2006 06:48 PM |
| script to add all numbers from 1 to 100 | ricc | Shell scripting | 3 | 08-17-2005 02:27 PM |
| How to find different type of words (pattern matching) in vi | sweta | Linux software | 2 | 06-07-2005 10:22 PM |