I have a file which is created by a program. It contains html code and propitiatory calls to other software. In this file there are many variations of:
<td>$GETR("wp","1")$Yes$GETR("","2")$No$NOTE()$</td>
so it could be:
<td>$GETR("dc","1")$Yes$GETR("","2")$NO$GETR("","3")$NA$NOTE()$</td>
or:
<td>$GETR("tc","1")$Yes$NOTE()$</td>
etc
I have created a script which properly formats these files but this bit I am stuck with.
I want the script to search through the file and if it finds more that one GETR between and then to put each GETR on a new line tabbed, so like:
<td>
$GETR("wp","1")$Yes
$GETR("","2")$No$NOTE()$
</td>
Now if there is only one occurrence of GETR between:
<td> and </td>
I would like it to be changed to GETC, so:
<td>$GETR("tc","1")$Yes$NOTE()$</td>
would become:
<td>
$GETC("tc","1")$Yes$NOTE()$
</td>
Any ideas how I can do this? I currently have a bash script which does some moving around which calls a python script to replace some formatting.
I am using Sun Solaris 5.10
Thanks
This is what you are desiring?
In that case try this