#1) (On unix server) Open the file to change in vi or vim (example: vi Filename.cpp)
#2) Run the replacement command in vi (or vim) as follows
:%s/^M$//
#NB: the ^M is 1 character that can be typed by using the following key combinations: [ctrl] + [v]; [ctrl] + [m]