[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Text files



> I must be missing something obvious, but other than writing a filter in C or
> using an app like fte, is there an easy way to convert mac/pc->text files to
> unix format, especially CR/LF translation?
> 

Install the sysutils package, comes with "dos2unix".

Or try :

  cat file | sed /s/^M//g > newfile.txt


Alternatively :

  cat file | tr -d '^M' > newfile.txt


If you use bash as your shell the above ^M is typed on the command line
as ctrl-v then ctrl-m to literally insert the ^M character.

There's probably hundreds of ways with available shell tools :)

What Mac program are you using that's inserting dos/^M?  Last time
I used a Mac they were using the same format as Unix (and Amiga :))


Reply to: