Page 1 of 1

Create a file with words within the delimiters (((( and ))))

Posted: Mon May 22, 2006 9:44 pm
by savesys
Without me writing a custom program in a programming language. Does the Advanced F&R utility have a way of creating a file that can output each occurrence of the (((( & )))) delimiters and the text between them..

For example:

This is a test of ((((a utility that might do what i need it to do)))). It has alot of features but not (((sure if it can do it))))
((((test3))))
((((test4))))


So the resulting output file would look anything like this

a utility that might do what i need it to do
sure if it can do it
test3
test4

and if so, how is it done.

Thanks
Mike

Posted: Tue May 23, 2006 9:14 am
by Abacre
Hi Mike,

Sure it's possible to do with Advanced Find and Replace.

Go to main menu - Action - Options - Batch Replace
check "Modifier S"
check "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid these lines,

Search for:
\A.*?\(+

Replace with:
empty

Search for:
\)+\s*\r\n\(+

Replace with:
\r\n

Search for:
\)+.*?\(+

Replace with:
empty

Search for:
\)+[^\)]*?\Z

Replace with:
empty

That's all. I verified it works perfectly.

Thanks One More Question

Posted: Thu May 25, 2006 2:22 pm
by savesys
It worked great, just as you said :) I am still trying to figure out how to change the delimiters. if i wanted to change the

((( and )))

to

[( and )]

How would I do so?


Thanks
Mike

Posted: Thu May 25, 2006 2:49 pm
by Abacre
It's easy:

Search for:
((( and )))

Replace with:
[( and )]

You even don't need to use regular expressions :)

Yep I knew that.. Just curious how the expressions worked

Posted: Thu May 25, 2006 4:49 pm
by savesys
Your original instructions worked great with this document:

This is a sample document (((Note #1))) and ((( Note #2 foobar)))

which made the file:

Note #1
Note #2


Now I was hoping to do the same with this document:
[( Note #1)] and [( Note #2 foobar)]

Where rather than ((( & ))) we have [( & )]

I can't figure out the expressions you sent me and where to make the changes in it to do as I need :(

Thanks
Mike

Posted: Thu May 25, 2006 5:48 pm
by Abacre
In the given expressions above:
replace all \( by \[\(
and \) by \)\]