thanks era...here are few more questions
2008-06-16 PROV_STATS:::919900546978::Nokia 6600: a e
2008-06-16 PROV_STATS:::919900546978::Nokia 6600: b f
2008-06-16 PROV_STATS:::919900546978::Nokia 6600: c g
the above file has 4 columns i want the output to be seperated with "|"
If you simply want to replace all runs of spaces and colons with a pipe character and add it at beginning and end of line, something like
sed 's/^/|/;s/$/|/;s/[: ][: ]*/|/g' file >newfile
It's not entirely obvious from your example how to get from input to output, but google for similar problems; there are lots of threads about this type of problem.
There are very old awk versions which might not be able to work with this script; if it doesn't work, see if you have nawk or mawk or gawk or XPG4 awk on your system.
(Actually with my copy of mawk, the last field was wrong when I set OFS="|" so this script is a bit of a workaround.)
Suppose data is available in file "abc.txt" with several lines in the same format as the line you have mentioned above . Loop works fine unless you have "!" in your data .
for i in `cat abc.txt | sed 's: :!:g' `
do
line=`echo $i | sed 's:!: :g'`
d=`echo $line|cut -d" " -f1`
t=`echo $line |cut -d"," -f1 | cut -d" " -f2`
num=`echo $line|cut -d":" -f6`
model=`echo $line | cut -d":" -f8`
echo "|$d|$t|$num|$model|"
done