Quote:
Originally Posted by
salaathi
Dears,
Both the codes worked for me.
Thanks a ton.
Vino,
I am able to understand the awk syntax.
Can u please explain the sed code.
sed -e "s/^\([^,]*,\)\([^,]\{9\}\),/\1X\2,/g"
^ - start at the beginning of each line
^\([^,]*,\) - collect that part of the string which starts from the beginning upto the place where you encounter the first comma and place it in buffer1
\([^,]\{9\}\) - Then collect any non-comma set of characters who length is 9 and then followed by a comma and then place it in buffer2
\1X\2, - dump the contents of buffer1 followed by a X followed by the contents of buffer2 followed by a comma.