Replace once in a line + add once
Posted: Tue Sep 07, 2010 12:56 pm
I think this kind of work cannot be done with standart functions, if not - please, help me out!
I have file with text lines split by ENTER
i need to:
Parse line by line
Find inline "text1" replace it with "text2" , if once replaced in line find next "text1" in this line and replace with "text3" and so on to "text4"
If "text1" found only 2 times, add "text4" to the end of the line
If there is no "text1" in the line, add "text2", "text3", "text4" to the end of the line
please help .
I have file with text lines split by ENTER
i need to:
Parse line by line
Find inline "text1" replace it with "text2" , if once replaced in line find next "text1" in this line and replace with "text3" and so on to "text4"
If "text1" found only 2 times, add "text4" to the end of the line
If there is no "text1" in the line, add "text2", "text3", "text4" to the end of the line
please help .