Hi All the Helpers!
I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt
input.txt
VOP 111 0 1 2
DEM 111 0 222 333 444 555
DEM 879 888 987 888 989
DEM 879 888 987 888 989
VOP 118 0 12 3 6
DEM 118 0 333 555 768 946
DEM 879 888 987 888 989
DEM 879 888 987 888 989
output.txt
VOP 0001 0 1 2
DEM 0001 0 222 333 444 555
DEM 879 888 987 888 989
DEM 879 888 987 888 989
VOP 0002 0 12 3 6
DEM 0002 0 333 555 768 946
DEM 879 888 987 888 989
DEM 879 888 987 888 989
So I need that the second column value get replaced by 0001,0002,0003 and goes on with incremantal 0001,but only for VOP and the 1st DEM after VOP.
Your help appreciated as always!!
Best Regards