LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

open , read and extract some data from a CVS File and then write the extracted data in a new CVS or TxT file

Hello everyone, 

I have to open ,read , extract data and modify its format   from many cvs files. Then I have to write or copy the extracted data into a new txt/cvi File.

 

I've read,opened and extracted some data in a Buffer but I couldn't write them in the txt file created at the beginning .So that I need your help.

 

ps: I didn't really get how the function "WriteFile" does work 

 

thank you in advance 

 

 

Download All
0 Kudos
Message 1 of 2
(2,062 Views)

Why are you calling WriteFile at all? An output buffer is written to disk when the file is closed and you have an fclose at the end of the code: isn't it writing the file? Throw all those WriteFile away: they are meaningless (and the compiler should complain about you passing a string instead of a file handle to them!).

 

WriteFile is more or less the same as fputs, but as a general rule you cannot mix functions from ANSI C and Formatting and I/O libraries: if you open a file with fopen you cannot the operate on it with WriteFile since ANSI C library uses FILE * handles while Formatting and I/O handles are simply integer values.

 



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,030 Views)