To trim 3rd field in for all the lines of a file and replace the modified string in that particular field.
For example i have a file called Temp.txt having content
Temp.txt
-----------------
100,234,M1234
400,234,K1734
300,345,T3456
----------------
So the modified file output should be
Temp.txt
-----------------
100,234,1234
400,234,1734
300,345,3456
----------------
Soplution: I did like this
while read line
do
VAR=`echo $line | cut -f3 -d ','` ( VAR=M1234)
VAR1=`echo $VAR | cut -c2-` (VAR1=1234)
???????????????????????????
??????????????????????????
done < Temp.txt
So please help me how i will replace VAR1 inplace of VAR and got the output as i specified above..
Thanks in advance...