LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to format the read from spreadsheet function

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 7
(3,865 Views)
Solution
Accepted by topic author Tombech84
Change the display format of your array indicator.
Message 2 of 7
(3,858 Views)

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

 

0 Kudos
Message 3 of 7
(3,847 Views)

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? 

0 Kudos
Message 4 of 7
(3,824 Views)

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

0 Kudos
Message 5 of 7
(3,818 Views)

altenbach wrote:
Change the display format of your array indicator.

 

Also, sorry about these very short message I sometime post here. This was posted via 3G while I was riding the bus. 😄
0 Kudos
Message 6 of 7
(3,815 Views)

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

0 Kudos
Message 7 of 7
(3,805 Views)