LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to write 1-d array from labview to excel row wise?

Solved!
Go to solution

hello, i am fresher in labview and want to learn it with help of all of u and ofcourse myself.

i have 1-d arrays of strings and i want to save it in excel file one by one and row by row. means one 1-d array in one row, next time, next one in next row and so on.

but i m finding i can do with only 2-d array. or array will be saved in one column. please help me. so that i can do further. i have evaluation version.

0 Kudos
Message 1 of 8
(5,626 Views)
Solution
Accepted by topic author janki

Hi janki,

do you want a real Excel File or file which can be opened by Excel? Do you have to write it row by row or is it also ok to write all your data at ones? Maybe the "Write to Spreadsheet File" function is enough for you.

 

Mike

Message 2 of 8
(5,624 Views)

THANKS MIKE....

in fact just after posting i tried write to spreadsheet file function and i got my answer. but are there any facility to include column headers to the file?

i tried with report functions but then again i could not found the function in reports to write 1-d array row wise. write table function is only there. see if u can help.

0 Kudos
Message 3 of 8
(5,606 Views)

Hi janki,

if you use the "Write to Spreadsheet File" function, then you get no real Excel File. You can add a "header" if you add the data to your array. If you need a real Excel file with all the advantages, then you have to use the report function or additional ActiveX functions.

 

Mike

Message 4 of 8
(5,602 Views)
Writing a header is not a lot of work : the write to spreadsheet comes in several flavours : you can choose between doubles, integers and strings. So start writing your column headers as an array on strings, then use again the function, and append your data as an array to the same file (see the bottom left input on the connector pane)
Message Edité par chilly charly le 01-12-2009 06:52 PM
Chilly Charly    (aka CC)
Message 5 of 8
(5,599 Views)

hey chilly,

thanks. and will u check the attached vi and let me know if such programming is practical or we should do it in a better way?

0 Kudos
Message 6 of 8
(5,592 Views)

Hi janki,

currently you have to run your vi two times. If you build your array including the headers before writing it to the file, then you have to write your data only ones.

 

Mike

Message 7 of 8
(5,564 Views)

janki a écrit:

hey chilly,

thanks. and will u check the attached vi and let me know if such programming is practical or we should do it in a better way?


As Mike said, you don't need to run your VI twice. See the diagram below.
Additionnally, use a path control instead of a string (converted later to a path :o). This way, you'll get a nice browse button as premium ! 😉

 

Message Edité par chilly charly le 01-13-2009 03:01 AM
Chilly Charly    (aka CC)
Message 8 of 8
(5,547 Views)