chanakya has asked for the wisdom of the Perl Monks concerning the following question:
Greetings
During the coding process I have encountered a situation where I have to search and replace a particular column
For example I have the following data:
I want to search and replace the column 16 (i,e STOCK) with "BOXXE".
Till now I've been doing as below
if the same word appears twice. Please suggest how to replace the word *only* in column 16.
Thanks
During the coding process I have encountered a situation where I have to search and replace a particular column
For example I have the following data:
All the output lines generated will be of the same format as above. Before writing to the fileAT0000937503|20060530|||142.708534||GROUP AG|30618720||||OPEN +|ISIN|4943402|VSE|STOCK|39600000|0.77320
I want to search and replace the column 16 (i,e STOCK) with "BOXXE".
Till now I've been doing as below
Sometimes it may be possible that the same line have the word "STOCK" twice. My current code fails$idx =~ s/STOCK/BOXXE/g;
if the same word appears twice. Please suggest how to replace the word *only* in column 16.
Thanks
Back to
Seekers of Perl Wisdom