[PLUG] Translating ^M to \n

Rodney W. Grimes freebsd at gndrsh.dnsmgr.net
Tue Aug 13 16:08:56 UTC 2019


> On Mon, 12 Aug 2019, Rodney W. Grimes wrote:
> 
> > I think od -c does NOT output the \n.. no, looked closely at a hd of the
> > file. First byte of the file is 0xa, A LF ok, so thats odd. After that the
> > lines do appear to be seperated by 0x0d, which is CR all by itself, these
> > are NOT CR-LF windows format files, the are CR seperated files from who
> > knows what?
> 
> > My guess.. this was a browser downloaded .csv file?  So line
> > endings have been mangled by the web.
> 
> file <filename> reports these are ASCII text, with very long lines, with CR,
> LF line terminators.

I believe from my looking at the file the first byte of
the file is perturbing what file things, as the first byte
is infact a LF, after that there are no more linefeeds
in all of the sample I downloaded.

> My understanding is that CR/LF is DOS style.

But file is being confused, by manual analysis says this is a pure
CR file with a single LF as byte 1.

-- 
Rod Grimes                                                 rgrimes at freebsd.org



More information about the PLUG mailing list