LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clusters to Spreadsheet (Excel)

Hello all,

 

I would like to save the array (clusters) I have and save it to a file. As you can see from the file, the clusters holds two string information ( date and time) and a numeric section. I would like to export this data to excel.

 

Conditions:

1) I want it to save to a specfic folder every single time I run the program WITHOUT asking me where to save the file

2) Saving a new file in the same folder should contain a template and go number itself according to that...(For example... Sample.csv...Sample(1).csv...Sample(2).csv and so on.

 

Ive tried to us etyhe write to spreadsheet functions and they don't meet my conditions.

 

Any help is great!

 

Thank you!

Download All
0 Kudos
Message 1 of 10
(4,040 Views)

Use advanced file functions folder list to get the name of all files in your save directory. Find the last file number and increment by 1. This is the new name. Also it will make it a lot easier if you pad the file numbers with zeros (example file0001.csv)  This makes it easy to sort  because you will not get file1.csv, file11.csv,file2.csv ect.

 

To save your data to a file use write to text file,  with a .csv file name.

0 Kudos
Message 2 of 10
(4,012 Views)

Thank you for your tip! Would you mind giving me a sample VI of what you said? I'm not sure how to even start with what you suggested.

0 Kudos
Message 3 of 10
(4,010 Views)

Here is a quick example how to work with strings. No guarantee bug free cause its going home time on Friday.

0 Kudos
Message 4 of 10
(4,003 Views)

Thank you for the VI! 

Where do i use the input for my spreadsheet of the program?

 

The cluster of arrays has been unbundled in a forloop and then converted into string. Question is, now what?

0 Kudos
Message 5 of 10
(3,970 Views)
This vi is to find the next file name, To format your data you use the concatenate. String for a csv file each column is separated by a comma And to end the row use the end of line constant on the string pallet. Each cluster would be a row and each column is the control value. Seeecam
0 Kudos
Message 6 of 10
(3,953 Views)
See write text to file examples. Use the file name from vi above
0 Kudos
Message 7 of 10
(3,951 Views)

I got this so far, but i want to transfer my data of array "FROM THIS" to "TO THIS"

0 Kudos
Message 8 of 10
(3,944 Views)
Use a for loop and a shift register. Make sur you initialize the shift register . Could initialize with empty string constant or column names for first row of file. Sorry cant give example because answering from my phone.
0 Kudos
Message 9 of 10
(3,941 Views)
You will need to use two for loops and a sift register in each. The inside 4 loop is for your column in the csv file and the outside loop creates a now row of data .
0 Kudos
Message 10 of 10
(3,939 Views)