LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert DOS file to UNIX file?

Solved!
Go to solution

Hi everyone,

I want to create a text file which has LF character as EOL. But in LabWindows the "\n" or "0x0A" generate CR/LF as EOL. How can i solve this problem?

Or can we convert this text file with windows command prompt?

0 Kudos
Message 1 of 2
(2,484 Views)
Solution
Accepted by topic author e_tanyeri

CVI should convert the newline to CR+LF only if you use OpenFile in ASCII mode:

When you perform I/O on a file in binary mode, carriage returns (CR) and linefeeds (LF) receive no special treatment. When you open the file in ASCII mode, each CR/LF combination translates to an LF when reading, and each LF translates to a CR/LF combination when writing.

 

Try opening the file in binary mode and write to as you are already doing: you should have no CR added at the end of lines.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(2,459 Views)