01-19-2012 04:48 PM
Is there a CVI function or a simple method to convert an ascii file to a binary file format? Here is some simple data C4 7E. I need to convert it to - ~. Any suggestions?
01-19-2012 06:32 PM
I expect that you have to elaborate. I do not expect that you missed the obvious: use fopen as if it is a binary file. You have to use fread and fwrite (instead of fgets and fputs). But I expect that you have some different purpose. And then you have to specify more detailed what you want.
01-20-2012 01:29 AM - edited 01-20-2012 01:33 AM
One possibility is to open the ASCII file to read with fopen ("asciifilename", "r"); and to open the binary file for writing using fopen ("binaryfilename", "wb"); Also have a look at the functions fread (), fwrite, and fclose() in the ANSI C library.The idea would be to read the data as text file, and then write the data in binary format. You do not need to convert anything on your own.
You may also want to have a look here
If your prefer, you can also use the functions ScanFile / FmtFile from the Formatting and I/O Library...