Code: Select all
MasterClass
{
Class1 : ClassName1 {
Field1: Value1
Field2: Value2
}
Class2 : ClassName2 {
Field1: Value1
Field2: Value2
Field3: Value3
}
Class3 : ClassName3 {
Field1: Value1
}
Class4 : ClassName4 {
Field1: Value1
Field2: Value2
Field3: Value3
Field4: Value4
Field5: Value5
}
Class5 : ClassName5 {
Field1: Value1
Field2: Value2
Field3: Value3
Field4: Value4
}
}
- the size of the file makes iterating through the records relatively slow (I mean, it's fast, but it's not instantaneous like, say, for this mini sample above), with around 236000 lines to parse and around 16000 "classes"/"objects" to deal with
- the particularities of Rainmeter, while enough for reading files and iterating through its records, makes writing the changes back to the same file a bit problematic, partly because of the default INI format, partly because of the overall size, and partly because using external tools like CMD, Powershell, VBScript or others have various drawbacks of their own, like speed, the use of regex, etc.
So, my question is, what alternatives exist to achieve this goal (reading such a file, iterating through its records, selectively change them, and writing the changes back to that file)? Are the already mentioned alternatives using external programs feasible for this scenario, or can it be done fast in Lua? If the latter, can you point me in the right direction or share a minimal script that can do it on the mini sample above (I would probably be able to read and write from/to file in Lua, but - preferably - placing those records in tree-like arrays/tables is a mistery for me at this moment)? Obviously, if that's the case, you can move the topic to the Lua section eventually.
P.S. If anyone wonders, this is about semi-automatically editing a decrypted savegame, instead of doing the operations manually in Notepad++.
