I have an XML I'm editing. It has about 40,000 lines.
What this is doing is finding an object in a file based on the conditions. It'll be a TextTool and have the LongID designated in each set. Once it finds it, it will replace the LongID with the given LongID below in the Actions block.
What I want to do is narrow my XML down to about 400 substitution blocks instead of 4,000.
My question is; is there a way to take a source list of all my LongID's and remove the ~3,600 blocks I don't need? So my list is:
I want to somehow find those (which in this example would be found on lines 7 and 15) and capture the whole <rule> block associated with those (Lines 1-10 and 12-20), and put that into a separate file. There will be a ton of LongID's that I don't have in my source list, but will appear as a Rule block in my XML. I basically want to omit those that don't have a match in my source.
I'm new to this, so I don't know where else to post this. Any help is appreciated. Thank you.
So if I understand you correctly, you want all the LongID's that are inside the Action blocks.
Note: I'm assuming that all LongID's inside the Condition blocks are N followed by some number, and that the LongID's inside the Actions block are all A through Z and _ If this is not the case then my suggestion probably won't work too well.
Install the LineFilter2 plugin (download is on the bottom of that page). This plugin allows you to pull out lines of a file into a new file. Run the plugin and search for <LongID>\w+</LongID> and make sure to enable Regular Expression search mode. That should have a new file pretty close to what you are wanting
and you will need to do some simple search/replace to remove unneeded text.
If you need any more help, feel free to ask.
This solution just extracts the LongID tags. If what you need is to remove all the blocks containing these tags, you'll need to search for
and replace with nothing, in regular expression mode, unchecking the ". matches newline" box.
Again, I'm not sure I got it either.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.