LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from a 2-d spreadysheet

It works for me on 8.2.1
0 Kudos
Message 11 of 18
(1,692 Views)
Very interesting lol. so the same program works for you doesn't work for me ......................................
i don't know what to say now......-_-..i guess i'll work on it more myself, rebooting the computer and such..see if anything gets better

thanks anyway for your help mike!
0 Kudos
Message 12 of 18
(1,686 Views)
Ok, just restarted everything, and ran the Q-factor.vi, the exact same one i uploaded..and i still get my values after being read from spreadsheet rounded off to integer.
attached is the image of the read from spreadsheet VI. as you can see on the right hand side, my X values are all 951,000 951,000 951,000....etc etc

my format is %.3f by default, i doubt that is the problem. but i dont' see anything else i can manipulate to get this to work.

anyone?


0 Kudos
Message 13 of 18
(1,682 Views)
Your problem is that your OS has a comma as decimal seperator, so the period in the datafile is not recognized as part of the number.
 
Go to your LabVIEW options and disable "use localized decimal point".
 
(You can also add "%.;" as part of the formatting code to switch on a case-by-case basis.)
0 Kudos
Message 14 of 18
(1,673 Views)
Stupid german computers....but yes, i realized that problem earlier and have changed first few data's decimal places to be comma, instead of period..so a file containing both period and comma is read from but still all of the data points regardless of comma or period are rounded off to integer...

and i've tried to find that option use localized decimal point but ccouldn't find it under option. i know some VI has an input to enable/disable this...where exactly is it under option may i ask?

and that format string, by adding do you mean %.;%.3f   something like that? or %.;3f? i've tried few combiantion but didn't work....

thanks for the help!
0 Kudos
Message 15 of 18
(1,663 Views)
ignore the last thread, it WORKED!!!! thank you all! it was the format thing....i used %.;%.6f and it worked just fine!!! thanks again! much appreciated!!!
0 Kudos
Message 16 of 18
(1,660 Views)
%.n will use n significant figures
%_n will use n decimal places
 
 
 
Just a heads up Smiley Wink
0 Kudos
Message 17 of 18
(1,657 Views)
It's right there.
 
 
If you have a mix of decimal places and delimiters, the file might have been edited manually. In this case, the number of spaces might be variable and some might have been replaced by tabs.
 
You should read the file as a string, do a global replace of all "." with "," (or vice versa), the use "Scan strings for tokens" in two stacked while loops to get the fields. (use an array of delimiters containing \n and \r to get the lines, then use another array of delimiters (\s, \t, etc.) to get the records. This VI contracts consecutive delimiters into one by default, so it will handle all irregularities automatically. Wrap it up in a nice subVI and you're set for life. 🙂
 
Yes, "%.;" switches to period, "%,;" to comma, and "%;" back to the default. Check the online help. (Page: Format Specifiers Syntax Elements)


Message Edited by altenbach on 06-05-2008 09:45 AM
0 Kudos
Message 18 of 18
(1,656 Views)