Page 1 of 1

Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 5:37 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 5:42 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 5:44 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 6:02 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 6:06 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 6:18 pm
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

Re: Find/Replace when editor has added newlines

Posted: Tue Jan 24, 2017 6:47 pm
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