Pattern match excluding spaces???

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
ezinestein
Posts: 13
Joined: Sat Nov 10, 2007 11:10 am

Pattern match excluding spaces???

Post by ezinestein »

Hello again,

As always, thank you for your help! I will usually spend a couple hours trying to figure something out, but then as a last resort I come here for help. I hope that's ok.

Is there a way to pattern match a line that has spaces... when the words I have do not have spaces?

Here is what I mean...

If I have a phrase like... 'california traffic school' in a text file... and I'd like to extract it... but all I have in another text file is that phrase minus the spaces... like... 'californiatrafficschool'...

Is there a way for me to extract the phrase with spaces using the matching phrase I have is without the spaces?

So again, I have this... 'dogtrainingvideos' and I'd like to extract the same phrase from a file... but the phrase has spaces between words like... 'dog training videos'.

Thank you.

Regards,
ed
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Pattern match excluding spaces???

Post by DataMystic Support »

Hi Ed,

Not, you can't do this. You would have to pre-process the file with 'california traffic school' in it so that it becomes
'californiatrafficschool', perhaps add line numbers, and then run the matching filter against it for californiatrafficschool.

Another approach would be to generate a file with 2 fields - e.g.

"california traffic school","californiatrafficschool"
"dog training videos'","dogtrainingvideos"

Then you can replace each match with, say, ##FOUND##, and then extract just those lines.
Post Reply