10-16-2007 06:09 PM
10-16-2007 06:30 PM - edited 10-16-2007 06:30 PM
Are you sure those "extra spaces" aren't already in your data file? What created this text file?
Viewing it has hex code format, the extra spaces show up as 00. A non-printable character in places like notepad often does not show up, (but perhaps the Labview string indicator allocates a space for it.)
There were also some non-printable characters at the beginning (FF FE). I calculated the string length and it came out to be 5822 characters, which is exactly the size of the data file in bytes. So that indicates to me that the "extra" stuff is in the file. I think the real issue is in whatever is creating the file is adding the unnecessary characters.

Message Edited by Ravens Fan on 10-16-2007 07:32 PM
10-16-2007 08:28 PM - edited 10-16-2007 08:28 PM


Message Edited by Matthew Kelton on 10-16-2007 08:30 PM
10-17-2007 06:37 AM
That works perfectly! Thanks for all your help. I figured it was something to do with the format. I had forgotten all about different encodings (I'm only vaguely familiar with them). Once you specified unicode though, it sounded familiar. The software I use is called Universal Analysis. It runs on a Windows machine, as does my LabVIEW. Once I started digging through the export options, I noticed a box for encoding and Unicode is the default, but there are also options for Windows (ANSI) and OEM (PC-8). Now I know both how to export in ANSI and to read in the Unicode if I need to.
Since I may share this program with others in my group, I'm wondering if there is a simple way to programmatically identify what the encoding is so the program could intelligently load either type of text file. At the very least, I can probably have it check for that first non-printing character, but that's probably not a very robust solution and probably specific to this programs output.
Thanks again!
-Tim
10-17-2007 09:11 AM
10-17-2007 12:22 PM
Thanks very much for that info. That makes things much easier. I have now set my program to read the first byte in binary form and check to see if value equals FEFF. Then I just use a case structure to handle each situation. Thanks again for all the help guys!
-Tim