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?
recode should do it if you can figure out the syntax. I usually use
awk -v RS="\r" '{ print $0 }' infile > outfile
'cause I can't be bothered to tinker with recode.
> Install the sysutils package, comes with "dos2unix".
>
> Or try :
>
> cat file | sed /s/^M//g > newfile.txt
That would remove all CRs without adding newlines. OK for DOS->Unix
conversion, useless for Mac->Unix. The Mac uses CR only as end of line.
Michael
Reply to: