Easily Merge XML Files with Similar Structure
XML MergerHere’s a great, simple, tool to merge XML files with a similar structure. It’s as seen in the below video.
We added some additional Hotkeys to the script after recording the video so look for them in the script (or the icon in the system tray)
BTW- This was created because someone watched this video where we demonstrated this script for merging files with similar headers.
💥 Merge XML files in seconds with this FREE tool! ⏰
Transcript from Video for Merging XML Files
hello it’s Joe glines from the-Automators the number one trusted source for teaching people how to use AutoHotkey we teach people how to automate repetitive tasks develop custom applications and adapt programs to their needs all of our courses come with the 200 money back guarantee so you have no risk whatsoever check them out so in today’s video we’re demonstrating a script we actually wrote for a client and the client reached out to me they watch this video I’ll put it up here
there’s a link to you can get to append text files that have a similar structure and so what it does is it Loops over the files gets the header from the first one removes the header from the Auto ones but appends all the data it makes it really simple it’s aHotkeys press it bam you’re done very simple he was curious if we could do the same thing with an XML file now if you’re familiar with XML files there’s a bit more of structure there’s not just a heading you have some other nodes that you have to
take care of right soI said yeah we could probably do that for you and we gave him a rate and got it done and I said hey do you mind if we share this code because it might help othe-Automator let’s look at the code a little here I’m not going to dive into the code too much because you’ll have the download it’s in v2 AutoHotkey we have it where it’s Ctrl shift M will merge the files
or and control Escape these are on the system tray icon basically now you have a trade menu so it reminds you of the Hotkey it’s an important thing control Escape will kill the program and control shift M are the two major Hotkeys those will merge the files unless and then we demonstrate it so it’s running right now let’s come back in here here are the files they’re all very similar I just I basically created this first file with bk101 and then I put a bk-102 in this file and I want a three in that file so
we can see them when we merge them so the tool operates in two ways which I I love this flexibility is I can either hit my Hotkey which right now I don’t have anything select I don’t have an XML file selected I’m going to hit Ctrl shift M and it’s going to ask hey select the files it looks in this local folder I can select them say open now save the XML file now we did a little more work here where it’s automatically going to save it on XML I can just say example if I don’t add XML it will append it if x miles there it
wouldn’t double do it so this is going to merge them in here we can select it takes a second to update here there we go and here you can see it kept the root node and wrapped it all but then shoved the Auto ones in that we did it by using a com object which is very simple to use especially in V1 or V2 the code’s not very different as far as that goes the other way which I really like is what this is more for my Approach I’m usually in Explorer I’ll select the files then I hit myHotkey Ctrl shift M now notice this is already
on the save as it detected we had files selected in Explorer and says oh look those are the files you want to merge what do you want to call it so we’ll call it example two and I’ll this time I’ll give it an XML extension just to show that it doesn’t repeat it but here we come up with the same once it refreshesthe same structure same file so thanks again Gil for letting us share thatand for the workwe do appreciate we do great worker we do a lot of teaching with AutoHotkey but we also do custom work so if you didn’t
know thatgive us a try if you have a script you have in mind or you don’t have the skill or you don’t have the time more importantly let us know maybe we can crank it out for you have an awesome day cheers oh if you learned something here like the video it really helps me out and subscribe if you’re not a subscriber we’re the largest AutoHotkey channel out there we have over 1300 videos teaching people AutoHotkey and it’s a great way to save time and decrease problems with your work cheers