Find/Replace in Files

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
sbodoff
Posts: 20
Joined: Tue Jun 14, 2011 10:42 pm

Find/Replace in Files

Post by sbodoff » Tue Aug 28, 2012 4:19 am

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.

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Find/Replace in Files

Post by adrian » Tue Aug 28, 2012 9:11 am

Hi,

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

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

arhebis
Posts: 16
Joined: Sat Nov 03, 2012 8:45 pm

Re: Find/Replace in Files

Post by arhebis » Sat Nov 03, 2012 8:48 pm

\n is not working for "find in files" with Regular Expressions.

Do you have an idea why?

Thanks,
Gabriela

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Find/Replace in Files

Post by adrian » Mon Nov 05, 2012 11:48 am

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

arhebis
Posts: 16
Joined: Sat Nov 03, 2012 8:45 pm

Re: Find/Replace in Files

Post by arhebis » Mon Nov 05, 2012 11:54 am

I'm using 13.0. So I'll probably have to upgrade then.

Thanks,
Gabriela

tcg71
Posts: 1
Joined: Tue Apr 08, 2014 3:57 pm

Re: Find/Replace in Files

Post by tcg71 » Tue Apr 08, 2014 4:01 pm

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

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Find/Replace in Files

Post by adrian » Tue Apr 08, 2014 4:22 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply