Hi,
I need to parse the lines in the source file, simply looping. Then, split each line on the asterisk.
The first part determines segments (there's an opening tag and a closing tag).
Within each segment, the first part of the line has an ID to denote a different block of lines that belong together (the same transaction).
For the prefix in the output file, it's simply some of the parts of the splitted line text. So asterisk splits up the line and we need to grab the 3rd or 4th item, something like this. That is not the difficult part.
The difficult part is identifying the different segments, then blocks within a segment. I have it all working in VBA, but now I am looking at performance and speed :-) that's why I'm here with Python. The only thing I was unsure of, is how to store the information on line numbers such that I can use it in a second pass to form the output text file.
I need to parse the lines in the source file, simply looping. Then, split each line on the asterisk.
The first part determines segments (there's an opening tag and a closing tag).
Within each segment, the first part of the line has an ID to denote a different block of lines that belong together (the same transaction).
For the prefix in the output file, it's simply some of the parts of the splitted line text. So asterisk splits up the line and we need to grab the 3rd or 4th item, something like this. That is not the difficult part.
The difficult part is identifying the different segments, then blocks within a segment. I have it all working in VBA, but now I am looking at performance and speed :-) that's why I'm here with Python. The only thing I was unsure of, is how to store the information on line numbers such that I can use it in a second pass to form the output text file.