http://www.perlmonks.org?node_id=977784

slayedbylucifer has asked for the wisdom of the Perl Monks concerning the following question:

hello Monks,

I need some regex help. I have a csv where in I want to edit the 35th field. In 35th field, I want to replace the "0" which is in the beginning of the string "and" is followed by 10 digits with "+91" and then write the change back. I do not want the output on the console but want to have it written back to the same file in the same field.

I thought this would have been an easier one with sed/awk but I could not yet make it work. Here is my thread with the sed/awk exploration:

http://stackoverflow.com/questions/11138434/sed-in-place-replacement

So, Now I am thinking of doing it with perl. Here is one sample input:

foo,foo,foo,,,,,,,,,,,,,,,,,,,,,,,* My Contacts ::: Phone Only,,,,,,,M +obile,02234567899,,,,,,,,,,,,,,,,,

So in above line, the number happens to be the 35th field. I want to change it from "01234567899" to "+912234567899".

Please provide your inputs.

-Thanks.