LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange character appear when writing to text file.

Hello, I am facing some problem when I read some data from and binary file (.dat) and then saving them into text file.
 
When I convert those data into string and then write to a text file. Some strange characters were found in the file when I opened it with excel. Could anybody tell me how these strange characters( ) are generated and how to eliminate them?
 
The VI , .dat file and the text file are attached as below.(use the "open file" in the menu to open .dat file and then use the "export file" in menu to export to text file)
 
Thank you very much......
 
The .dat and text file are attached in the next post.
Download All
0 Kudos
Message 1 of 4
(4,038 Views)
raw data file.
 
Thank you very much.
 
the vpsxxxx.ini is the raw data(file with .dat extension cannot be attached).
 
viewer.vi is the menu file. (please change the file name to viewer.rtm, also for attaching file purpose. ^_^)
 
Download All
0 Kudos
Message 2 of 4
(4,031 Views)
Hi ZXHF,

you try to write an array of strings to disk. In this array each element is started with the length of the string as an I32 (or U32). So that probably will be the strange characters. You should use concatenate strings just like you did with the tab and data concatenation.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 4
(4,026 Views)

Thanks Ton

It works as what you said after changing the "build array" into "concatenate string".

Thank you very much.

So does it mean that array is not fit for text file writing because of the length information?

Anyway, I always can learn something from this forum. Thanks

 

0 Kudos
Message 4 of 4
(4,008 Views)