Find for number greater than x

Find, replace, find in files, replace in files, regular expressions

Find for number greater than x

Postby Packman » Thu Mar 27, 2008 1:15 pm

I am using our recently purchased UltraEdit V14.00a. I can't seem to find the same type of question in a search in thsu forum so I will ask and apoligize ahead of time if it has been covered.

I have a file with the following text in it multiple times:

bytesIn=xxxx

The line actually looks like this:
[Thu Mar 27 09:55:56 2008] 0000233c 00001844 - PLUGIN: parent:ver=1,ip=10.241.31.140,time=1205946081945,pid=9020,reqid=10801,event=1 - current:ver=1,ip=10.241.31.140,time=1205946081945,pid=9020,reqid=10801,event=1 type=HTTP detail=/doc/ARBWeb/caseload/caseNotes.do elapsed=3547 bytesIn=0 bytesOut=170580
It is output from a Websphere Plugin log.

The number after "bytesIn" could be from 1 to 9999999999.
I would like to search this large file for any occurances of bytesIn= where the number after the = sign is greater than some number. Sometimes I would search for a number greater that 1000 and sometimes greater that 1000000.

I have played around with both UltraEdit and Unix regular expressions but can't seem to find the right syntax.
Any help would be appreciated.
TIA
Packman
Newbie
 
Posts: 2
Joined: Thu Mar 27, 2008 10:56 am

Re: Find for number greater than x

Postby mjcarman » Thu Mar 27, 2008 1:54 pm

You can't search for numbers greater than a certain value (that would require a code callback to perform the comparison) but you can search for numbers with a certain number of digits.

For example, a search for bytesIn=\d{4,} (Perl syntax) will find values with at least four digits.
User avatar
mjcarman
Power User
Power User
 
Posts: 123
Joined: Thu Feb 10, 2005 12:00 am

Re: Find for number greater than x

Postby Packman » Thu Mar 27, 2008 2:36 pm

:lol:
Wow, that was easy... I knew it would be if you just knew the syntax but I would not have thought of using Perl
Thanks Again
Packman
Newbie
 
Posts: 2
Joined: Thu Mar 27, 2008 10:56 am


Return to Find/Replace/Regular Expressions