Search by position

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

Search by position

Postby ssjody » Thu Aug 25, 2005 6:07 pm

I have a file with many rows and would like to do a search in all rows that contain the letters PK in positions 94-95 of each row then display each complete row that contains this value in new window.

I know this is going to be really easy but I new to UE and I'm spending too much time trying to figure it out. Help!

Thanks Jody
User avatar
ssjody
Newbie
 
Posts: 2
Joined: Wed Aug 24, 2005 11:00 pm

Re: Search by position

Postby roland » Thu Aug 25, 2005 9:14 pm

If you're doing this just to find information (and don't plan on making any changes that you'll want to save), I've found the file sort feature very usefull for this.

File->Sort->Advanced Sort options:

Just put columns 94 and 95 in the two fields for 'Key 1', click 'Sort' and all lines in the file will be sorted by those two columns. Just scroll down until the column shows PK and they'll all be grouped right there.
User avatar
roland
Basic User
Basic User
 
Posts: 30
Joined: Sun Aug 15, 2004 11:00 pm

Re: Search by position

Postby ssjody » Fri Aug 26, 2005 12:16 pm

Thanks for the reply. My delima is the file is very large (254,000) rows. Sorting by a column takes a long time. I need a faster way to do this. Any other suggestions?

Thanks Jody
User avatar
ssjody
Newbie
 
Posts: 2
Joined: Wed Aug 24, 2005 11:00 pm

Re: Search by position

Postby mrainey56 » Fri Aug 26, 2005 3:47 pm

This is ugly, but it works.

Use this for your search string:

^.............................................................................................[P][K].*$

Have List Lines Containing String and Regular Expressions checked
Unix-style regular expressions

You can copy the found lines to the clipboard

I tested a 250,000-row file on my P4-1.6 laptop - took 120 seconds
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Search by position

Postby PaoloFCantoni » Fri Aug 26, 2005 3:57 pm

LOL,

"Don't force it, use a bigger hammer!"

I like it!

Cheerz,
Paolo
User avatar
PaoloFCantoni
Power User
Power User
 
Posts: 113
Joined: Sun May 01, 2005 11:00 pm
Location: Perth, Western Australia


Return to Find/Replace/Regular Expressions