Modifying existing files?

Jan 6 at 8:42 PM
In looking through the various threads and the code involved in running the project it seems like modifying existing files wasn't an intended use case.
However, in trying to use the code tools to work with the files I'm running into a bit of a snag, and it might just be that I'm missing something.

So, we're trying to bill a state organisation with an 837, however our databases and their databases disagree on what Identifier goes in a specific segment. I know exactly how to check and fix the codes in a logical sense, but I'm uncertain if it's possible to use this library of tools to get just a specific loop without extraneous data.

The specific issue I'm trying to fix is that data in loop 2330B's NM109 element, which may or may not need to be changed based on the value of loop 2010BA's NM109 element.

Knowing whether or not a value needs to be changed is easy enough to handle, however I'm having a fairly significant amount of trouble finding a way to get to a specific loop or segment aside from the ISA or GS segments.

I've tried using X12Parser.UnbundleByLoop(interchange,"2330B") but it seems to be giving me a full interchange but creating a new envelope for every 2330B loop.

Any help or pointers to a useful method would be appreciated.
Jan 9 at 9:29 PM
Nevermind, I used the Serialize method on Interchange to convert the files to XML, then used XPath queries to isolate the 2000B loops and a foreach to find all the related elements I needed to change before transforming it back to x12. If there is demand I'll post the code, but this forum is pretty dead.