LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save data in spred sheet file as it is ?

Solved!
Go to solution

hello,

 

I want to save one table in spred sheet file same as i read from my external device.

here in attachment I have attached the vi.

that is the sample data which i want to save for example in first column i want only numbers without any floating points.

and in remaining column what everdata is, it should be same.

 

In attachment file name 11 is the same file which i want but i am getting always like attachment 2 file,

can you please guide me how can i get data same which is displayed in labview table.

 

Thank you very much in advance.

Download All
0 Kudos
Message 1 of 5
(2,334 Views)

AnkitRamani,

 

The file 11 shows 5 columns. The file 2 shows 4 columns. The VI you posted had no data in the array, so we do not know how many columns are in the data. So it is somewhat confusing to guess exactly what you want.

 

The Write to Spreadsheet File.vi cannot use different formats for different columns. Use the number to string functions separately on each column to get the string formats you want. Then combine the string arrays and write to a text file.

 

Lynn

Message 2 of 5
(2,313 Views)

Thank you very much for your reply.

 

Both file should have same number of coulum and row, but the thing is here I attached only for example purpose.

That if i want to save any table for example in first row has 4 column and its value is for example

                                                  1234   -1.234  0.243  23

some thing like that.

then when i save this data in spread sheet file then i am getting data like in first row:

                                                1234.0000  -1.234   0.234   23.0000 

 

data is ok, but i want same data which i have entered befor becase i want to compare both the data so 1234 is not matched with 1234.0000 in my case.

 did you get my point, that i want same data means  like this for example

                                                1234   -1.234  0.243  23 but, not like  this  1234.0000  -1.234   0.234   23.0000.

 

Thank you very much once again for your help.

0 Kudos
Message 3 of 5
(2,290 Views)

Hi Ankit,

 

there are powerful options for the format string you provide when saving the spreadsheet data. On option allows the remove trailing zeros. Guess that's what you are looking for…

 

It's all in the LabVIEW help, just read it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(2,280 Views)
Solution
Accepted by topic author AnkitRamani

This code - using Format into String - creates an output very similar to the 11.log file. You can write the string to a file with Write to Text File or write the string array with Write to Spreadsheet File.vi.  Write to Spreadsheet File.vi internally converts String array to what is in String and then writes it as text, so it makes more sense to just use Write to Text File. Using Write to Spreadsheet File.vi will make extra copies of the data, which can become a problem if the dataset is large.

 

Read the Detailed Help for Format into String for more information on the format codes available.

 

Lynn

Message 5 of 5
(2,264 Views)