Question says it all, I’ve got a 500,000 line file that gets generated as part of an automated build process on a Windows box and it’s riddled with ^M‘s. When it goes out the door it needs to *nix friendly, what’s the best approach here, is there a handy snippet of code that could do this for me? Or do I need to write a little C# or Java app?
Share
Here is a Perl one-liner, taken from http://www.technocage.com/~caskey/dos2unix/
You can run it as follows:
Or, you can run it also in this way (the conversion is done in-place):
And here is my (naive) C version:
You should run it with input and output redirection: