Thats quite straightforward. Find a script skeleton below:
Code:
#! /bin/ksh
typeset fInput="/data/m/b.csc" # input filename
typeset fOutput="/data/o/tran.csv" # output filename
if [ -r "$fInput" ] ; then # perhaps there should be more input validation
print -u2 "unable to read input file"
exit 1
fi
sed 's/^\([^,]*,[^,]*,[^,]*,\)\([0-9]\{1,5\}\),/\1000\2/
s/^\([^,]*,\)[^,]*,\([^,]*,[^,]*,[^,]*,\)[^,]*,\([^,]*\).*$/\1\2\3/' $fInput > $fOutput
exit $?