Grepping Errors in a file

Hey All,

I have to grep for an error from a file and get the results of errror in a different file......

But there should be no duplicate entries. Can anyone help me in giving a shell script for this

This is file which contains pattern error which I am supposed to grep and put this in a different file....And this should happen everyday

2007-02-01 23:00:18 Error : this file has error
2007-02-05 24:00:00 date : this afiel ca
2007-02-01 13:00:00 Error : Hi again
2007-02-04 23:00:00 Error : this is again a error
2007-02-04 15:05:00 Error : hi

grep ":[0-9][0-9] : Error :" <file1> | cut -c21- | sort -u > <file2>

sed -n '/Error/p' currfile | sed 's/\(.*\):\(.*\):\(.*\)/Error :\3/' | sort -u > newfile
sed -n '/Error/s/\(.*\):\(.*\):\(.*\)/Error :\3/p' file

Oh!

Thats a cool one!

The OP had asked for sorted output and thats why sort -u was included.

Hope that was a typo!