LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating spreadsheet blank spaces

Hi

I have found some data and with to save it to a file that i can open with excel, when creating the spreadsheet i need titles and blank spaces between data, i know that i have to change the data to a string but am unsure on how i would create the blank spaces, i have attached an image of the spreadsheet of how i would like it to look, sum direction on how to do this would be appreciatied

 

cheers jake

0 Kudos
Message 1 of 9
(3,736 Views)

Do you want to do this by way of a write to "spreadsheet" file function to create a .csv text file?

 

Or do you want to create a true .xls Excel spreadsheet file and place the data in it using ActiveX?

 

(Note, I put spreadsheet into quotes on the first line because that function is poorly named and confuses lots of people.  People think they are working with a spreadsheet when they use it, when in reality, it just creates a text file that could be opened by a spreadsheet program)

0 Kudos
Message 2 of 9
(3,731 Views)

thanks for the reply 

 

well i was going to use just a .csv text file, as it can be opened by excel and statistics can be done on the data, thats all i wish to do, are there any advantages in doing it either way. am i still able to create a "spreadsheet" like the image i provided using .csv

 

jake

0 Kudos
Message 3 of 9
(3,709 Views)

Hello Jake,

 

It is possible to create a file of CSV data and allow for blank cells.  The 'Write to Spreadsheet File.vi' will allow you to save in either .txt or .csv, depending on the File Path you wire. 

 

You mentioned that your use of the Spreadsheet file is to perform Statistics.  LabVIEW Full Development System and greate includes several Statistical and Mathematics tools that you can use directly from which your block diagram, as oppose to using the additional step of importing your saved data into other packages. 

 

However, to carry your data into a spreadsheet format, you can manipulate it into an array.  How is your original data formatted, and what is it's content, in terms of data representation?  If your dimensions of the array are known, use the 'Initialize Array.vi' an then parse through the data in a loop, while passing the data to the 'Insert into Array.vi.'  Under the condition that you require, you can use the approriate index to pass an 'Empty String Constant.' 

 

Regards,

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 9
(3,695 Views)

 hi

 

my data is in a series of numbers and 1-d arrays that i want to combine to create a 2-d array with the titles and blank spaces shown i am using doubles
 


0 Kudos
Message 5 of 9
(3,673 Views)

Yuur best bet is to determine how large your array needs to be in length and width to do what you want.  Probably a matter of length of your largest array plus some additional rows for the header and some space info..  Intialize an empty 2-D string array according to the dimensions you calculate.  Use replace array subset to place your headers in your appropriate cells.  Use Replace Array Subset, to place each 1-D array in it proper position.  Anything that hasn't been replaced by a header or an array will still be an empty string.

 

Now when you feed the 2-D string array to the Write spreadsheet function, everything should be delimited just right to make it look the way you want in Excel when Excel imports in the text file.

0 Kudos
Message 6 of 9
(3,666 Views)
I know the size of the 2-d array that i wish to initialize, does that mean i initialise the array with empty string contants, then replace with my headers, can you convert the 1-d arrays into string that i am then able to put into the appropriate position in the array, im unsure if this sounds stupid.
Message Edited by jakenz on 11-25-2008 04:51 PM
0 Kudos
Message 7 of 9
(3,654 Views)

Yes.

 

You can convert a 1-D array of numbers to a 1-D array of strings using the number to string conversion functions.  They are polymorphic, so they will take arrays as well as scalars.

0 Kudos
Message 8 of 9
(3,646 Views)
Message Edited by jakenz on 11-25-2008 07:40 PM
0 Kudos
Message 9 of 9
(3,641 Views)