Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying content without tags from an XML file in Notepad++

Tags:

xml

notepad++

I'm not quite familiar with XML files and Notepad++, so a simple solution is better, however clumsy it may be.

I have a large XML file and I'm trying to copy only the content between the tags (hope my terminology is right). To be sure I'm clear, from all the text in the screenshot below I would like to copy only the following text and paste it elsewhere:

DISCUSSION

In this study I

have demonstrated

an approach the

Notepad++ screenshot

Is there any simple and quick way to do so for many lines of text at once?

Any help will be greatly appreciated!

like image 704
Brassican Avatar asked Dec 03 '25 15:12

Brassican


1 Answers

Open up the find and replace window by pressing ctrl+h.

Set the 'Search Mode' to 'Regular expression'.

In the 'find what' text box enter: (?s)<[^><]*?> and leave the 'replace with' text box empty.

Press the replace all button and the tags should disappear.

This is a quick and easy fix using notepad++ but may not work if there are CDATA tags present or comments containing < or >. You'll need an XML parser for more reliable transformations.

like image 103
JonM Avatar answered Dec 06 '25 10:12

JonM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!