I need a conversion utility/script that will convert a .sql dump file generated on Mac to one readable on Windows. This is a continuation of a problem I had here. The issue seems to be with newline formatting in text files, but I can’t find a tool to make the conversion…
I need a conversion utility/script that will convert a .sql dump file generated on
Share
Windows uses
carriage return+line feedfor newline:Unix only uses
Line feedfor newline:In conclusion, simply replace every occurence of
\nby\r\n.Both
unix2dosanddos2unixare not by default available on Mac OSX.Fortunately, you can simply use
Perlorsedto do the job:Code snippet from:
http://en.wikipedia.org/wiki/Newline#Conversion_utilities