If we create files in windows and copied to linux boxes, we can see some ^M characters.. These are normally the new line character. We can remove these characters using the utility, dos2unix command. Or in vi editor, we can do a search and replace, as follows: :%s/^M//g
Remember, the ^M is nothing but the combination of 'ctrl+alt+M' and NOT shift+6+M
Just as u mentioned, ^M can be obtined by 'ctrl+v + enter', also.
I had to export some values which was in csv format. I needed to get those in values in separate lines, in windows. Instead of opening it in MS-Word or application like that, i opened that i gvim, and gave a search/replace :%s/,/^M/g ^M - 'crtl+v enter'
2 comments:
can you explain the scenario...
If we create files in windows and copied to linux boxes, we can see some ^M characters.. These are normally the new line character. We can remove these characters using the utility, dos2unix command. Or in vi editor, we can do a search and replace, as follows:
:%s/^M//g
Remember, the ^M is nothing but the combination of 'ctrl+alt+M' and NOT shift+6+M
Just as u mentioned, ^M can be obtined by 'ctrl+v + enter', also.
I had to export some values which was in csv format. I needed to get those in values in separate lines, in windows. Instead of opening it in MS-Word or application like that, i opened that i gvim, and gave a search/replace
:%s/,/^M/g
^M - 'crtl+v enter'
Post a Comment