I have a text file so:
F 93246 allapviep1n200011900a 1 APVI
I 0 Date 10/04/2000
I 1 Time 20:04:00
I 2 Station pcde24
I 3 User admin
I 4 IPath images/allapviep1n200011900a
I 5 Prio 5
D 828 allapviep1n200011900a_828 2
A I num_polizza=020468324
A I sig_cogn=XAS
A I cod_tipo_doc=199
A I data_doc=17/04/2007
A I protocollo_doc=IAAL0000000007400191
#Allnet I protdc=IAAL0000000007400191
#Allnet I coddoc=199
#Allnet I numpol=020400324
#Allnet I sigcog=XAS
#Allnet I statosal=B
#Allnet I malatt=N
#Allnet I ricove=N
#Allnet I vispec=N
#Allnet I fircon=S
#Allnet I firass=N
#Allnet I conprv=N
#Allnet I firprv=V
P 1 00001.tif
P 2 00002.tif
D 829 allapviep1n200011900a_829 4
A I num_polizza=020400324
I need to replace the number in red with a start value as 1 with and increment with value +1 and so on for all this lines.
F 93246 allapviep1n200011900a 1 APVI
I 0 Date 10/04/2000
I 1 Time 20:04:00
I 2 Station pcde24
I 3 User admin
I 4 IPath images/allapviep1n200011900a
I 5 Prio 5
D 1 allapviep1n200011900a_1 2
A I num_polizza=020468324
A I sig_cogn=XAS
A I cod_tipo_doc=199
A I data_doc=17/04/2007
A I protocollo_doc=IAAL0000000007400191
#Allnet I protdc=IAAL0000000007400191
#Allnet I coddoc=199
#Allnet I numpol=020400324
#Allnet I sigcog=XAS
#Allnet I statosal=B
#Allnet I malatt=N
#Allnet I ricove=N
#Allnet I vispec=N
#Allnet I fircon=S
#Allnet I firass=N
#Allnet I conprv=N
#Allnet I firprv=V
P 1 00001.tif
P 2 00002.tif
D 2 allapviep1n200011900a_2 4
A I num_polizza=020400324
Thanks for your help...
F 93246 allapviep1n200011900a 1 APVI
I 0 Date 10/04/2000
I 1 Time 20:04:00
I 2 Station pcde24
I 3 User admin
I 4 IPath images/allapviep1n200011900a
I 5 Prio 5
D 828 allapviep1n200011900a_828 2
A I num_polizza=020468324
A I sig_cogn=XAS
A I cod_tipo_doc=199
A I data_doc=17/04/2007
A I protocollo_doc=IAAL0000000007400191
#Allnet I protdc=IAAL0000000007400191
#Allnet I coddoc=199
#Allnet I numpol=020400324
#Allnet I sigcog=XAS
#Allnet I statosal=B
#Allnet I malatt=N
#Allnet I ricove=N
#Allnet I vispec=N
#Allnet I fircon=S
#Allnet I firass=N
#Allnet I conprv=N
#Allnet I firprv=V
P 1 00001.tif
P 2 00002.tif
D 829 allapviep1n200011900a_829 4
A I num_polizza=020400324
I need to replace the number in red with a start value as 1 with and increment with value +1 and so on for all this lines.
F 93246 allapviep1n200011900a 1 APVI
I 0 Date 10/04/2000
I 1 Time 20:04:00
I 2 Station pcde24
I 3 User admin
I 4 IPath images/allapviep1n200011900a
I 5 Prio 5
D 1 allapviep1n200011900a_1 2
A I num_polizza=020468324
A I sig_cogn=XAS
A I cod_tipo_doc=199
A I data_doc=17/04/2007
A I protocollo_doc=IAAL0000000007400191
#Allnet I protdc=IAAL0000000007400191
#Allnet I coddoc=199
#Allnet I numpol=020400324
#Allnet I sigcog=XAS
#Allnet I statosal=B
#Allnet I malatt=N
#Allnet I ricove=N
#Allnet I vispec=N
#Allnet I fircon=S
#Allnet I firass=N
#Allnet I conprv=N
#Allnet I firprv=V
P 1 00001.tif
P 2 00002.tif
D 2 allapviep1n200011900a_2 4
A I num_polizza=020400324
Thanks for your help...