Hi
! Reading your request, you’re asking for a huge work to do. What you want here is a Scanner tool, which parses your text into tokens, uses a lookahead function to see if the next token is a good match for one of your cases (controlling the possible cases into a select statement for example at each iteration, basically seeing the previous token/s) and if it finds a correct match than replaces the text and appends it to the correct stream to write into the final file. You could think to write it using regex and it would be probably computational expensive and dirty, a pure hell in some cases. It’s not complex and can be implemented in a clean way with goroutines, but requires time! I’ll try to help you if I have time, but first try to think something like this by yourself, following this as idea.
1 Like