delete lines
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 4
- Joined: Tue Apr 12, 2016 3:51 pm
delete lines
Hello!
I have a huge about 700000 lines xml file.
I would like to delete whole lines where I find this code: label="9"
What is the easiest way to do this?
I use oxygen 12.0
I have a huge about 700000 lines xml file.
I would like to delete whole lines where I find this code: label="9"
Code: Select all
<note player="@ndre�_0989" label="13" update="1460278894"></note>
<note player="\�_�7" label="9" update="1455205849"></note>
<note player="A.RiverR@t�" label="9" update="1455205849"></note>
<note player="absolutim�o" label="9" update="1460278894"></note>
<note player="Aces�Ashes69" label="8" update="1460278894"></note>
<note player="acib�983" label="9" update="1455205849"></note>
<note player="acib�983" label="9" update="1455205849"></note>
I use oxygen 12.0
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: delete lines
Hi,
You can do this in the Find/Replace dialog (menu > Find > Find/Replace). Note that this will blindly delete entire lines. Use with caution.
Enable Regular expression
Find: Replace with: leave empty
Press Replace All
Regards,
Adrian
You can do this in the Find/Replace dialog (menu > Find > Find/Replace). Note that this will blindly delete entire lines. Use with caution.
Enable Regular expression
Find:
Code: Select all
^.*?label="9".*?$\n
Press Replace All
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: delete lines
Hello,
Details about the regular expression syntax used in the Find/Replace dialogs from Oxygen can be found here:
Oxygen XML Editor - Regular Expressions Syntax
There is a very useful interactive tutorial on regular expressions here:
http://regexone.com/
One aspect to note is that there are many flavors of regular expressions. Oxygen uses the Java (Perl5-based) kind.
Regards,
Adrian
Details about the regular expression syntax used in the Find/Replace dialogs from Oxygen can be found here:
Oxygen XML Editor - Regular Expressions Syntax
There is a very useful interactive tutorial on regular expressions here:
http://regexone.com/
One aspect to note is that there are many flavors of regular expressions. Oxygen uses the Java (Perl5-based) kind.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Tue Apr 12, 2016 3:51 pm
Re: delete lines
Hi!
Thanks your links I will check it.
Now I work with a similar xml file.
I would like to add a new line every time after these characters:
I tried /n but this didn't work.
Can you please tell me the code what can do this?
I would like my xml looks like this:
Thanks your links I will check it.
Now I work with a similar xml file.
Code: Select all
update="1460623854"></note><note player="13ďż˝Sa1nt" label="13" update="1455205849"></note><note player="13�Sa1nt" label="13" update="1455205849"></note><note player="1m@g!N�" label="13" update="1460623854"></note><note player="2Fool4Your�" label="9" update="1460623854"></note><note player="4KiNgHďż˝lL" label="9" update="1455961705"></note><note player="666Li�ák" label="9" update="1460623854"></note><note player="6�saro�6" label="13" update="1460623854"></note><note player="7b�SiiieCH" label="13" update="1460623854"></note><note player="@fury@��42" label="13" update="146062385
Code: Select all
"></note>
Can you please tell me the code what can do this?
I would like my xml looks like this:
Code: Select all
update="1460623854"></note>
<note player="13�Sa1nt" label="13" update="1455205849"></note>
<note player="13�Sa1nt" label="13" update="1455205849"></note>
<note player="1m@g!N�" label="13" update="1460623854"></note>
<note player="2Fool4Your�" label="9" update="1460623854"></note>
<note player="4KiNgH�lL" label="9" update="1455961705"></note>
<note player="666Li�ák" label="9" update="1460623854"></note>
<note player="6�saro�6" label="13" update="1460623854"></note>
<note player="7b�SiiieCH" label="13" update="1460623854"></note>
<note player="@fury@��42" label="13" update="146062385
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: delete lines
Hi,
If you want to insert a line break between start and end tags, it's best to search for the actual tags </note><note and place the line break between
Find: (</note>)(<note)
Replace with: $1\n$2
Each pair of parenthesis determines a capturing group that is referred with $n (n = 1..9)
Regards,
Adrian
If you want to insert a line break between start and end tags, it's best to search for the actual tags </note><note and place the line break between
Find: (</note>)(<note)
Replace with: $1\n$2
Each pair of parenthesis determines a capturing group that is referred with $n (n = 1..9)
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “General XML Questions”
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