I need to change the id of ns3:app.message to follow this sequence - 1,10,100,1000,1001,1002,1003,1004,1005, 1006, 1007, 1008, 1009, 101, 1010, 1011, 1012, 1013. Or to simplify it could be just sequence starting from 1000. It should restart from 1000 every time for a new env:transaction tag. Some bug in third party system means that these id needs to be in alphabetical sequence but still in numerical format. Like you enter numbers in a column in excel and treat them as alphabetical and sort them.
@sammyp75 , , welcome, we hope you find the forum useful and educational. NB: its not our role to write complete solutions but to help you find them , and typically there's more than one way to solve
what have you tried/attempted - please share all - successful or otherwise
show example of EXPECTED OUTPUT, we might be able to guess, but you know what is actually expected, so this will help the team give pointers to assist.
please, provide COMPLETE examples not bits '....' doesn't mean anything
i've also edited your post and put it in markdown - you only need the backticks at the start and end not on every line
if writing this in java then an iterator over the parts being generate should be a trivial task.
I presume you are experienced coder .... if not please give an idea of your level of technical expertise.
Java wouldn't be my go to for this if it was an operation I was performing in isolation, I'd use a simple script to do something like the following:
step through each line resetting an id variable to 1000 if there's a new transaction, otherwise substituting the id if it's a new message and incrementing the id variable. However the complexity of the text in the message could break this approach.
Java's Xerces library is useful for this kind of processing, there's a good intro here , Have a go at using it to modify your data and show us how you're getting on if you've any questions.