[Tutor] Terminating "\M" characters with regard to csv.DictWriter

Cameron Simpson cs at cskk.id.au
Sun Aug 8 23:04:18 EDT 2021


On 08Aug2021 21:57, boB Stepp <robertvstepp at gmail.com> wrote:
>>All works as I would like except that the newly generated csv file has 
>>a
>>'\M' at the end of each line.  I only became aware of this when doing a
>
>In a comment to the answer at
>https://unix.stackexchange.com/questions/82536/showing-type-of-newline-character-in-emacs
>
>it says:
>
><quote>
>And if you set the buffer to Unix line endings when the file contains DOS line
>endings, it will show the CRs as \Ms at the end of each line – Michael Mrozek
>Jul 10 '13 at 19:53
></quote>
>
>I imagine emacs and vim display things similarly and I know you use Linux.
>Could this be it?

And for reference, the "M" is likely because \r (carriage return) is 
character 13, also known as control-M because you can often enter it 
that way, and M is the thirteenth letter of the ASCII alphabet, thus the 
convention.

So yes, Alex needs tighter control of the line ending.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list