I wish to search a large text file line by line, and find each entry containing "N:;;" and just simply change it to "N:07401000000;;" and then the next occurrence of "N:;;" would be changed to "N:07401000002;;" and so on throughout the complete file of entries. Here is an example below of before and after.
Before:
BEGIN:VCARD
VERSION:2.1
N:;;
TEL;TYPE=CELLVOICE:07401000000
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:;;
TEL;TYPE=CELLVOICE:07401000001
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:;;
TEL;TYPE=CELLVOICE:07401000002
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:;;
TEL;TYPE=CELLVOICE:07401000003
END:VCARD
After result would look like this:
BEGIN:VCARD
VERSION:2.1
N:07401000000;;
TEL;TYPE=CELLVOICE:07401000000
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:07401000001;;
TEL;TYPE=CELLVOICE:07401000001
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:07401000002;;
TEL;TYPE=CELLVOICE:07401000002
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:07401000003;;
TEL;TYPE=CELLVOICE:07401000003
END:VCARD
Any help or ideas would be awesome.
Do you want the
Nvalues to start at a hard-coded value and increment or just copy the value from the subsequent CELLVOICE?
Actually that is a good idea. How about the value mentioned within CELLVOICE.