04-16-2010 12:57 PM
Hello All
I am having a small problem with the read from spreadsheet function. I need to format it as a . seperated file with tab as delimiter and the precision (the # of numbers to the right of the decimal point) should be 7.
Right now I am using the following format string: %.;%.7f, but this only outputs 3 numbers to the right of the decimal point.
The file I am trying to read from uses . as decimal point and my vi should be able to run on both system types (. decimal point and , decimal point).
I don't quite know if it possible to use multiple formats in the read from spreadsheet function?? Maybe with the help of brackets ??
Think the help file is confusing!!
Thanks
-Tommy
Solved! Go to Solution.
04-16-2010 01:06 PM
04-16-2010 01:14 PM
Ohh man, used a couple of hours trying to fix this problem myself, can't believe it was sooooo simple.....
Thanks a lot!
Have a nice weekend, I know I will 🐵
Regards
Tommy
04-16-2010 02:21 PM
Remember, data (e.g. orange wires) is always at the full resolution of the datatype. If you specify a format, you are telling the read function how the is formatted in the text file. There is no information retained how it should be displayed in subsequent indicators.
We have not answered your second question on how to automatically read both comma and period formatted fractional numbers. I would probably read it as as plain string, check for the presence of a comma, and then convert the string to an array accordingly.
How big are these files?
04-16-2010 02:35 PM
Hi
The log file is always with . as the decimal point, so I was interested in how to force the read from spreadsheet to read . decimal points.
But i guessit should do this with the %.; format.
The file size is 1-2MB.
Thanks
-Tommy
04-16-2010 02:41 PM
altenbach wrote:
Change the display format of your array indicator.
04-16-2010 03:02 PM
No need for apologies! It works, thats the most important!
But it all works like I want it to, so once again thanks for the support!
Regards
-Tommy