I have a large xml that has the below structure:

            <subform name="PRE_EC02_S1A">
                <field name="RIGA07">R7</field>
                <field name="RIGA08">R8</field>
                <field name="IMPOR20">I20</field>
                <field name="IMPOR21">I21</field>
                <field name="IMPOR22">I22</field>
                <field name="IMPOR23">I23</field>
                <field name="IMPOR24">I24</field>
                <field name="IMPOR25">I25</field>
                <field name="IMPOR26">I26</field>
                <field name="IMPOR27">I27</field>
                <field name="IMPOR28">I28</field>

I need to delete all the values from all of the fields. I can do it manually but as the document is very large it will take a lot of time. I would like to know if there is a way to delete them automatically. For example: I need deleted all the values like R7, R8, I20, I21 and so on

Thank you very much in advance.

2 Answers 2


I have tested this with the sample you provided and it works in Notepad++. Open the replace dialog (Ctrl+H) and select at the bottom "Regular expressions". Then type the following: ([\>]).*([\<]) Replace with: \1\2

Edit: If you happen to have other xml tags with text inside you do not want to delete, if you want to empty only the field tags, then search for the following:

([\<]field name[\=\"].*[\"\>]).*([\<]\/field[\>])

Replace again with \1\2

  • Thank you John. It works just fine. You spared me a lot of time. Thank you again!!!!!!
    – Massimo
    Mar 21, 2014 at 13:10
  • You are welcome. Glad it worked.
    – Kard Nails
    Mar 21, 2014 at 13:57

Another useful way of deleting data that is lined up as nicely as yours is using block selection. Hold you Alt-key while dragging with the mouse to select a square, (or alt+shift+arrow keys)then press delete.

Gif from Notepad++ feature description:

(source: notepad-plus-plus.org)

See more here: https://notepad-plus-plus.org/features/column-mode-editing.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .