find and replace with line break in multiple files
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 37
- Joined: Tue Mar 27, 2007 5:46 am
find and replace with line break in multiple files
Hi,
The "Find/Replace" dialog when working on the current file allows for inserting line breaks but the "Find/Replace in Files" dialog does not. Why is that? Is there a way to insert line breaks in multiple files? For example, how could I replace the text
abc/><xyz
with
abc/>
<xyz
in all the files in my project?
Thanks,
Wolfhart
The "Find/Replace" dialog when working on the current file allows for inserting line breaks but the "Find/Replace in Files" dialog does not. Why is that? Is there a way to insert line breaks in multiple files? For example, how could I replace the text
abc/><xyz
with
abc/>
<xyz
in all the files in my project?
Thanks,
Wolfhart
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: find and replace with line break in multiple files
Post by sorin_ristache »
Hello,
As you can read in the tooltip of the Replace field you have to use {$NEWLINE} in the replace expression where you want to insert a newline character.
Regards,
Sorin
As you can read in the tooltip of the Replace field you have to use {$NEWLINE} in the replace expression where you want to insert a newline character.
Regards,
Sorin
-
- Posts: 37
- Joined: Tue Mar 27, 2007 5:46 am
Re: find and replace with line break in multiple files
Hi again,
One more question: What if I want to reverse the above step, that is, replace
abc/>
<xyz
with
abc/><xyz
in all files in my project? I tried Text to find="abc/>{$NEWLINE}<xyz" and Replace with="abc/><xyz", but that doesn't work.
Thanks,
Wolfhart
One more question: What if I want to reverse the above step, that is, replace
abc/>
<xyz
with
abc/><xyz
in all files in my project? I tried Text to find="abc/>{$NEWLINE}<xyz" and Replace with="abc/><xyz", but that doesn't work.
Thanks,
Wolfhart
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: find and replace with line break in multiple files
Post by sorin_ristache »
That is not possible in the current version because the find expression of the Find/Replace in Files dialog can cover only one line. We plan to enhance it in a future version to cover multiple lines as in the Find/Replace dialog used in a single file (the action from menu Find -> Find/Replace). We will let you know when we will have implemented it.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: find and replace with line break in multiple files
Hi,
Recent versions of Oxygen allow you to search and replace with full multi-line support.
If this does not work for you maybe you can tell us what version of Oxygen you are using and give a small example about what you are trying to do.
Regards,
Radu
Recent versions of Oxygen allow you to search and replace with full multi-line support.
If this does not work for you maybe you can tell us what version of Oxygen you are using and give a small example about what you are trying to do.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Nov 15, 2017 9:59 pm
Re: find and replace with line break in multiple files
Hi,
I'm trying to find and replace (with a space, so trying to find and delete) an element that covers multiple lines:
<mods:subject authority="lcsh">
<mods:name type="corporate">
<mods:namePart>InsertNameHere</mods:namePart>
</mods:name>
<mods:topic>Literary collections</mods:topic>
</mods:subject>
I'm using version 20.0. When I try to insert all of this into the find and replace dialog (for multiple files) it only includes the first line: <mods:subject authority="lcsh">
Is there a way to do what I'm hoping to?
Thank you,
Amanda
I'm trying to find and replace (with a space, so trying to find and delete) an element that covers multiple lines:
<mods:subject authority="lcsh">
<mods:name type="corporate">
<mods:namePart>InsertNameHere</mods:namePart>
</mods:name>
<mods:topic>Literary collections</mods:topic>
</mods:subject>
I'm using version 20.0. When I try to insert all of this into the find and replace dialog (for multiple files) it only includes the first line: <mods:subject authority="lcsh">
Is there a way to do what I'm hoping to?
Thank you,
Amanda
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: find and replace with line break in multiple files
Hi Amanda,
In the Find field you can insert the entire set of tags on one line separated by a single space between the tag names:
and then check the "Ignore Extra Whitespaces" checkbox.
Or fo to the top level Tools menu->XML Refactoring->"Delete element" and use as XPath something like:
I usually consider that XML-aware changes (which involve searching for entire XML elements) should be best done with the XML Refactoring tools because they should find your element no matter how many whitespaces or line breaks you have between the tags of the element.
Regards,
Radu
In the Find field you can insert the entire set of tags on one line separated by a single space between the tag names:
Code: Select all
<mods:subject authority="lcsh"> <mods:name type="corporate"> <mods:namePart>InsertNameHere</mods:namePart> </mods:name> <mods:topic>Literary collections</mods:topic> </mods:subject>
Or fo to the top level Tools menu->XML Refactoring->"Delete element" and use as XPath something like:
Code: Select all
//*:subject[@authority='lcsh'][*:name[@type='corporate'][*:namePart[text() = 'InsertNameHere']]]
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service