Is there a way to rename XML files using values inside?

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Is there a way to rename XML files using values inside?

Postby CaiquePV » Mon Jul 10, 2023 7:27 pm

Hey guys!

Every month I need to rename some XML files in a specific way. I usually use BRU to delete some letters from the file names and put a hyphen at the end, with the option "Add" -> "Suffix", then I open each file and copy a specific number inside them to paste in the name.

However, now I need to rename all my XML files using the numbers of two tags inside them. Of course the XML will have a LOT of tags inside, but the only ones I'll need to use to rename my files are the <nNF> and <chNFe> tags.

My files should be named "<nNF>-<chNFe>.XML". For example, if inside the <nNF> tag I have the number 3569 and inside the <chNFe> I have the number 334499123, my file should be called "3569-334499123.XML".

I tried to read Tim Mongeon's Operations Manual, and I believe I will need to use the "RegEx" function, but I'm having some difficulties understanding it because English is not my first language lol

So... Is there a way to rename my files using the numbers inside those specific tags? Also, if there's anything specific in the manuals that you guys recommend I read, let me know and I'll try to translate it into my language to try to learn how to do it.

Thanks in advance! And thank you all for providing this wonderful tool and the support for it.
CaiquePV
 
Posts: 1
Joined: Mon Jul 10, 2023 6:48 pm

Re: Is there a way to rename XML files using values inside?

Postby Admin » Wed Jul 12, 2023 7:03 am

Hi, BRU can't do that atm, that is, it cannot read/parse the file content and then use it to rename it, sorry!
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support