I have set of windows files and unix files. I want to convert all those files into mac files file format.
Any help would be appreciable.
feedback
|
This question came from our site for professional and enthusiast programmers.
|
The question doesn't explicitly say, but I assume you mean text files, and need to convert the line delimiter format? OS X doesn't ship with command-line file converter tools, you have to build them yourself. Perl is good for Q&D utilities like this:
or, to convert in place:
Note: this script is a little more complicated than it probably needs to be, because it's written to work on on both PC-format (CRLF line terminators) and unix files (LF terminators), and leave files that're already in the old traditional MacOS format (CR separators between lines) alone. Also, the PC and unix formats put a terminator after the last line, while Mac format doesn't (it uses line separators, not terminators), so this script detects when it's actually translating, and removes the last delimiter. | |||
|
feedback
|