Page 1 of 1

Find/Replace in Files

Posted: Tue Aug 28, 2012 4:19 am
by sbodoff
Is there any way to specify a newline in the "Replace with" field in the Find/Replace in Files dialog? I'm looking for the equivalent to the "Insert Newline" option that is available in the Find/Replace dialog.

Re: Find/Replace in Files

Posted: Tue Aug 28, 2012 9:11 am
by adrian
Hi,

You can enable Regular Expression and use in the Replace with field '\n' (without the quotes).

Regards,
Adrian

Re: Find/Replace in Files

Posted: Sat Nov 03, 2012 8:48 pm
by arhebis
\n is not working for "find in files" with Regular Expressions.

Do you have an idea why?

Thanks,
Gabriela

Re: Find/Replace in Files

Posted: Mon Nov 05, 2012 11:48 am
by adrian
Hi,

What version of Oxygen are you running (Help > About)?

Are you using '\n' in mid expression to search content that spans over two or more lines?
e.g. a\nb which translates to:

Code: Select all

a
b
Please note that the "Find/Replace in Files" tool from v13.2 and earlier searches one line at a time, so this type of expression will not work. You can only search up to and including the \n character on each line. e.g. a\n

Starting with v14.0 the "Find/Replace in Files" tool has been improved to search for content that spans across multiple lines. That means that searching for a\nb works now.

Regards,
Adrian

Re: Find/Replace in Files

Posted: Mon Nov 05, 2012 11:54 am
by arhebis
I'm using 13.0. So I'll probably have to upgrade then.

Thanks,
Gabriela

Re: Find/Replace in Files

Posted: Tue Apr 08, 2014 4:01 pm
by tcg71
Hi,

I'm using Oxygen 15.2, but have the same problem. Using \n in serach expression doesn't find any match, but using \s+ it will accept whitespaces and newlines. Why is \n not working ?

Same expression works when searching in within one file.

Thomas

Re: Find/Replace in Files

Posted: Tue Apr 08, 2014 4:22 pm
by adrian
Hi,

Are you searching just for '\n' or are you using '\n' in a larger expression?
In what type of files are you searching this?
Are there any other options (other than 'Regular expression') enabled in the Find/Replace in Files dialog?

Regards,
Adrian