I have a structured file where every line has the same format. I need to insert the same character multiple positions in the line and apply the same to all the lines. I have a list of positions where characters need to be inserted. The position is actually character after which my character needs to go.
For example positions are: 2,5,7,11,15 and character is ;
Line:
GO12 ABCDEFG 32
Result:
GO;12 ;AB;CDEF;G 32;
Everything I could find is based on repeating distance or finding a character/word around which the insert happens. Here only the positions are constant. Most of the text is variable.
Xnimak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.