How to determine the line ending of a file

前端 未结 7 1814
忘掉有多难
忘掉有多难 2020-12-23 09:32

I have a bunch (hundreds) of files that are supposed to have Unix line endings. I strongly suspect that some of them have Windows line endings, and I want to programmaticall

7条回答
  •  暖寄归人
    2020-12-23 10:17

    Windows use char 13 & 10 for line ending, unix only one of them ( i don't rememeber which one ). So you can replace char 13 & 10 for char 13 or 10 ( the one, which use unix ).

提交回复
热议问题