Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (6.1k points)
edited by

My application is unable to read windows format EOL file. How can I detect the format of files or to convert the EOL to the linux format?

1 Answer

0 votes
by (11.7k points)

 We can detect EOL format from windows to Linux in C++

Follow the steps listed down below:

  1. Open file in binary mode

  2. Then, find first '\n' byte

  3. Now, check if byte before found one equals '\r'

But there isn't such functionality in the standard library which is available. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 29, 2020 in Linux by blackindya (18.4k points)

Browse Categories

...