How to remove ^M at the end of every line

Hi, today i just gone through a serious problem between windows and unix.

Problem description:

Whenever i move file from windows to UNIX with winscp. Every line got ^M at the end in every file.


I opened that file in vi and done this

 Where ^ is (Control V) and M is (Control M).
It will remove all the trailing ^M at the end of every line.