We can remove this characters with a simply search and replace of vim with this command:
The ^M character is not valid write first ^ character and then M it's not the valid character. To write correctly this we must push Control+v and Contro+M keys, then appear our ^M Character.
Take care with this.
About David Millán Escrivá
David completed his studies in Universidad Politecnica de Valencia in IT with a Master's degree in artificial intelligence, computer graphics, and pattern recognition, focusing on pattern recognition and Computer Vision. David has more than 15 years of experience in IT, with more than ten years of experience in Computer Vision, computer graphics, and pattern recognition, working on different projects and start-ups, applying his knowledge of Computer Vision, optical character recognition, and augmented reality. Co-Author of two OpenCV books and reviewer of few more.