To remove the extra spaces at the end of each line in a file

I have a file of about 10k records and eace line is having an extra space of 5 byte at the end.. Iwant to remove the extra spaces at the end of each line.. Can someone please help me out.. I tried using sed command and its not working... can someone please help me out.

try sth like

sed 's/[ \t]\+$//' file

Can you explain this command what [ \t]\+$ this does?

[ \t] -- Space or Tab \t .

\+ -- Matches One or More instances.

$ -- Check for the Instance ending with pattern.