NoobProgrammer
MIS
I have a text file that I'm looking for all occurrences of >>Client. I want to then insert a line above it with <Record>1</Record>. The next occurrence would have <Record>2</Record> and so on. I’m not sure if sed would be more appropriate, but I’m not how to do it in either program regardless.
I’ve used ++ in awk which does give me the incremental count, but I don’t know how to reinsert it into source.
Sample Source
--------
>>Client
Data in between
>>Client
Data in between
>>Client
Data in between
Final Output to File
-------
<Record>1</Record>
>>Client
Data in between
<Record>2</Record>
>>Client
Data in between
<Record>3</Record>
>>Client
Data in between
Any help would be much appreciated.
I’ve used ++ in awk which does give me the incremental count, but I don’t know how to reinsert it into source.
Sample Source
--------
>>Client
Data in between
>>Client
Data in between
>>Client
Data in between
Final Output to File
-------
<Record>1</Record>
>>Client
Data in between
<Record>2</Record>
>>Client
Data in between
<Record>3</Record>
>>Client
Data in between
Any help would be much appreciated.