I have a huge text file with contents similar to this:
<!-- $var = aaa -->
<!-- $var = aaa -->
<!-- $var = aaa -->
<!-- $var = aaa -->
<!-- $var = aaa -->
.
<!-- $var = bbb -->
<!-- $var = bbb -->
<!-- $var = bbb -->
<!-- $var = bbb -->
<!-- $var = bbb -->
I want to achieve that the $var will be replaced like this:
<!-- $address = aaa -->
<!-- $city = aaa -->
<!-- $zip = aaa -->
<!-- $phone = aaa -->
<!-- $geo = aaa -->
.
.
<!-- $address = bbb -->
<!-- $city = bbb -->
<!-- $zip = bbb -->
<!-- $phone = bbb -->
<!-- $geo = bbb -->
The sequence is always the same. I have researched for about 3 hours, but I can't get past this brain hurdle. My idea was to realize this with regex, but it seems I need a script to wrestle with this.
Can you give me a hint into which direction to go and is this possible with Regex at all? I'm a beginner, so please be gentle :)
Kind regards Oliver