Thanks for your quick and dirty code to solve my problem. As I am a new to this kind of work, I could not able to understand the solution but it is great. I have one more request to the output. If I need only specific rows like I do not want 0.000 rows to the out put. then How can I proceed. I know one way, to do this by grep -v. But anyother way.
That awk line is terrific!
But using shell script with same assumptions as before, to suppress zeros:
while read a
do
if [[ $a = --* ]]; then
lf=$(echo $a|wc -w)
secs=$(echo $a|cut -d' ' -f $lf)
msecs=$(( $secs * 1000))
if [ $msecs -gt 0 ]; then
print
print -n "$secs |"
fi
else
if [ $msecs -gt 0 ]; then
print -n " "$a
fi
fi
done < YourOriginalFile > YourReformattedFile