LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recalling Spreadsheets and appending results into 1 file.

Hi,

 

i am in a stage of my program where i have to do numerical analysis on a set of data collected by an Optical spectrum analyser... the data has been saved in multiple spreadsheets... (each with a row for the wavelengths, x-values, and power, y-values)...i need to get the power values and put them all in 1 spreadsheet file, with the wavelngth values in the first row.

 

so multiple 2D spreadsheets: Wavelength:  x1 x2 x3 .....

     Power 1     : P1 P2 P3....

 

     Wavelngth: x1 x2 x3...

     Power 2    : p1 p2 p3...

 

Will turn to: Wavelength:  x1 x2 x3...

Power1:P1 P2 P3...

Power2:p1 p2 p3...

 

 

 

attached below is my attempt at doing this, which doesnt seem to work. The loops are present so that 'read from spreadsheet' vi recalls all the spreadhseets...which it does do... but i don't know how to improve it so that all the files succesfully append into 1 2D array (as shown above).

 

Please can someone help me figure out how to do this (recall multiple spreadsheets and then save into 1). right now only the files being recalled in the last loop iteration are saved into the single spreadsheet. 

 

the file paths of the spreadsheets are all dependent on the number (N) so the file paths are such that 00.txt,01.txt,02.txt,03.txt...0N.txt, 10.txt,11.txt...1N.txt,20.txt,21.txt... etc ...NN.txt and teh final file will be RESULTS.txt (as seen in the pic)

 

Any input will be greatly appreciated, it seems like an easy concept, but the answer totally evades me.  

thanks a lot,

Asiri  

0 Kudos
Message 1 of 10
(3,578 Views)

like this?

 

arr.PNG

0 Kudos
Message 2 of 10
(3,570 Views)

ah, well, not quite..though very similar, i have the all the spreadsheets saved in a folder, so i want to recall them and append them all into 1 file much like what you have shown, however what i am having trouble with is recalling a N^2 number of files and appending them into 1. 

 

in my attachment i have made a loop to recall the files, and they are indeed recalled, just not passed on through the loop into the 'append array' VI properly.  

 

thank you. 

0 Kudos
Message 3 of 10
(3,559 Views)
use the write to spreadsheet.vi and the read from spread sheet.vi
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 4 of 10
(3,557 Views)

😄 as you can see in the image, i have used the required VIs to recall and save the spreadsheets, what i am having problems with is appending ALL of the spreadsheets, my loops are not working properly, i only append a select number of spreadsheets/arrays together dependent on the loop iterations,

 

perhaps its something wrong with the way i got everything wired? i index at the outer loop, however this information gets lots in subsequent iterations... what i need ideally is some sort of VI which inserts sub arrays into consequative rows in an array though just one input (such as in my loops).

 

any suggestions are greatly appreciated.  

 

thank you! 🙂

 

 

asiri  

0 Kudos
Message 5 of 10
(3,552 Views)
Can you attach a few files for us to get an idea. I still think proper indexing will and building will solve your problem.
0 Kudos
Message 6 of 10
(3,519 Views)

hi, managed to solve it, altho its not fully complete i've attached setup which appends the Power rows into just 1 spreadsheet. 

 

 

thanks for alll the suggestions 🙂  

0 Kudos
Message 7 of 10
(3,511 Views)
 

I think that adding an "Transpose 2D array" between the loop and the "Insert Into Array" vi in your first code will solve your problem.

0 Kudos
Message 8 of 10
(3,500 Views)

Sorry to mislead you Radioman but reading your other post makes me realize that you get a 3D array out of those loops!

Shame on me that I didn't realize that in the first place Smiley Sad

 

So this is the code to handle your problem

SNAG-027.jpg

 

Be sure to have the option "Concatenate Inputs" checked with the "Build Array" or you will again end up with a 3D array.

Hope this helped 🙂

Message 9 of 10
(3,488 Views)

thank you! 🙂 

 

asiri  

0 Kudos
Message 10 of 10
(3,484 Views)