Is there a good tool for mass comparing and editing xml files?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Is there a good tool for mass comparing and editing xml files?

Post by Max Bain »

Hi,

is there a good tool to compare values of several items and where you can mass edit values?
For example if I want to see all prices for all ships and then I want to multiply the costs of a specific set of ships by factor 2.

Anyone has a good tool for that? Or are you doing this by hand so far?

Thank you!
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
mcal9909
Posts: 71
Joined: Thu, 22. Jul 10, 05:50
x3tc

Re: Is there a good tool for mass comparing and editing xml files?

Post by mcal9909 »

Python or Java Script are great tools for this kind of thing.
User avatar
DogyAUT
Posts: 44
Joined: Sat, 19. Jan 13, 19:29
x4

Re: Is there a good tool for mass comparing and editing xml files?

Post by DogyAUT »

I mostly work with Notepad++ when working with ini, XML, yaml or similar code.

With custom color theme codes it makes it quite easy to read. But afaik has no complex value replacement options (only stuff like search in several files and replace X with Y). But it supports custom plugins - so someone might already have a plugin which expands that.
Bifidus
Posts: 15
Joined: Sat, 1. Dec 18, 22:38
x4

Re: Is there a good tool for mass comparing and editing xml files?

Post by Bifidus »

I'm new to all this but notepad++ works quite well I find. There's also the search and replace function wich works with multiple files but since you have to write the patch xml files after it's not really useful. But yeah most of the work is manual I'd say but by searching values and macros around you quickly find everything you need :)
iforgotmysocks
Posts: 1244
Joined: Fri, 8. Nov 13, 22:35
x4

Re: Is there a good tool for mass comparing and editing xml files?

Post by iforgotmysocks »

Hm, i wrote a little program yesturday that takes a value from an xpath node from all xml files in a directory, applies an operation, like multiply with a value and then creates a xml patch file for it. I could send it over if it would help you, but it only works for a single attribute yet, gotta implement multiple selections yet.

Example: https://cdn.discordapp.com/attachments/ ... nknown.png

Lemme know if it would help and i'll send it over. :)
Bifidus
Posts: 15
Joined: Sat, 1. Dec 18, 22:38
x4

Re: Is there a good tool for mass comparing and editing xml files?

Post by Bifidus »

iforgotmysocks wrote: Fri, 7. Dec 18, 22:01 Hm, i wrote a little program yesturday that takes a value from an xpath node from all xml files in a directory, applies an operation, like multiply with a value and then creates a xml patch file for it. I could send it over if it would help you, but it only works for a single attribute yet, gotta implement multiple selections yet.

Example: https://cdn.discordapp.com/attachments/ ... nknown.png

Lemme know if it would help and i'll send it over. :)
Yes please ! Getting the path right is something that I'm still struggling with (and notepad is not helping) so this would be perfect :)
iforgotmysocks
Posts: 1244
Joined: Fri, 8. Nov 13, 22:35
x4

Re: Is there a good tool for mass comparing and editing xml files?

Post by iforgotmysocks »

Oh, u'll still have to enter the path once, but u don't have to do it for 100 files, depending on what u want to change. xD Give me a sec.

Simple add and remove patches work now aswell, just as replace.

https://mega.nz/#!wEhSmQIT!Rdl6ExVMQaFH ... cgNoYw2hFI

Return to “X4: Foundations - Scripts and Modding”