03-25-2009 08:38 PM
Good day,
I am using Labview 7.0 to develop my application which will select items from multicolumn listbox and display them in another multicolumn listbox then the contents will be saved to atext file.
I have problem when the data includes the Characters 0x09 or 0x0A because they won't show in the txt file and also it will shift the data in the listbox and in the output file and as aresult that will cause an error.
is there any technique to handel those characters?
Thanks in advance for your time and effort.
Solved! Go to Solution.
03-25-2009 08:45 PM
You could use the "Search and Replace" string function to convert all 0x0A's to 0x20's, then do the same with the 0x09's. Does that give you enough of a head start? (I'm on my way out the door and can't provide too many details)...
03-26-2009 12:20 PM
03-26-2009 02:42 PM
Matt,
here is my code for your review.
I want to use Edit.vi to create a code.
this code will be saved to new.txt after that I'll load it to 3 arrays in the file script_array.vi
I have problem with 0xA because as you can see in the attached files it always shift the line.
Thanks
03-26-2009 09:20 PM
OK, here you go... there's a couple of extra things in here I forgot to delete, but this works.
First, I used the read from spreadsheet file vi. If you look at the "all rows" indicator, you'll see why that doesn't work. And you can't fix it with delimeters.
So then we go through each row of the array. If it's an even row, we put the data in column 0 in Extracted Row and the data in column 1 in Extracted row 2. If it's an odd row, we put the data in column 1 in Extracted row 3.
I've attached the VI (in version 8.6.1) and also the PNG files. There might be an easier way, but this should work.
03-27-2009 09:17 PM
03-27-2009 11:09 PM
03-27-2009 11:17 PM
Good day Matt,
Many thanks for your time and effort.
To solve the problem with 0x09, I used (+) as Delimiter.
The tricky one is the 0x0A.
I used search and replace string function as you suggested which helped me to save the data in the TXT file in the correct order.
You will see when you run the code the 0x0A won't show because it will be replaced with nothing which is ok for now but when I am going to implement the second phase of this project I'll have some problems because I have to send the full string on a serial port and if the 0X0A is missing there will be errors.
I guess I have to figure out how to insert the 0x0A in the string before sending it.
Kind Regards
03-28-2009 04:52 AM