Find/Replace when editor has added newlines

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Find/Replace when editor has added newlines

Post by ann.jensen »

Hi,
I need to do a Find/Replace in Files across my entire project for the phrase

Code: Select all

   <ph conref="../../../../../t_content_refs.dita#t_content_refs/iproperty"/>
However, in many instances Oxygen has put in a newline which breaks this up e.g.

Code: Select all

   <cmd>Log in to <ph
conref="../../../../../t_content_refs.dita#t_content_refs/iproperty"/> as a
user with an Add and Update HOA role.</cmd>
Is there some option in Find/Replace in Files that will allow the search to find such instances?
Thanks in advance,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find/Replace when editor has added newlines

Post by Radu »

Hi Ann,

In the Find/Replace in Files dialog there's a checkbox called "Ignore extra whitespaces". If you enable that, Oxygen should ignore extra whitespaces which may appear in your search string.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Find/Replace when editor has added newlines

Post by ann.jensen »

Hi Radu,
But the extra white spaces are not in my search string, they are in the source that I am searching.
Thanks,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find/Replace when editor has added newlines

Post by Radu »

Hi Ann,

Please try the checkbox. It should do what you want. It ignores extra whitespaces found in the XML document between the pieces of content you are searching for.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Find/Replace when editor has added newlines

Post by ann.jensen »

Hi Radu,
Sorry I should have said that I did try it earlier but it didn't pick up on those instances in source where there was a newline.
Regards,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find/Replace when editor has added newlines

Post by Radu »

Hi Ann,

What I did to test this on my side was to have in the project a DITA task containing something like:

Code: Select all

<step>
<cmd>Remove the o<ph
conref="../../../../../t_content_refs.dita#t_content_refs/iproperty"/>ld oil filter.</cmd>
</step>
and then using Find/Replace in Files, searching for <ph conref="../../../../../t_content_refs.dita#t_content_refs/iproperty"/> with the checkbox enabled. And it worked for me, the match was found although it was on multiple lines.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Find/Replace when editor has added newlines

Post by ann.jensen »

Ok, I see that does work now.
I don't know what I was doing this morning that it wasn't finding the phrases that I copied in :-|
Sorry for the confusion,
Regards,
Ann
Post Reply