LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change spreadsheet format

Hello,

 

 

I am trying to make an spreadsheet test result more readable for users. It currently prints out as a very long row of data shown below.

Raw Data in a long rowsRaw Data in a long rows

 

 

 

I would like to break up this data and make it appear in rows. Similar to this:

 

Easier to read in columnsEasier to read in columns

 

 

 

 

Thanks.

0 Kudos
Message 1 of 5
(1,154 Views)

You post in the LabVIEW forum, but all you show us are Excel images.

 

As a first step, you need to tell us how you generate the sheet you don't like. Are you using the report generation toolkit or are you just writing a tab delimited text file that you then import into excel.

 

If possible, show us some LabVIEW code! Thanks!

0 Kudos
Message 2 of 5
(1,142 Views)

The file is first initialized here in step 2. Column header names are created and made into an array

 

Step1 .PNG

 

 

Then the test results are saved here:

 

Data written.PNG

 

I was thinking of using the 'read spreadsheet vi' , then picking out subarrays which can be transposed.

0 Kudos
Message 3 of 5
(1,122 Views)

Sorry, we don't do code images. Attach your VI instead.

(With few exceptions, images can't tell the whole story. What's in the other cases? What the file extension? What are typical values? What are the data structures?)

 

  • Why are there so many (so many!!!!) local variables????
  • Why is there so much Rube Goldberg code to create the headers instead of just having a string array diagram constant? (Also, Insert into array is not the correct tool to append 1D arrays)
  • Why is there an abort after the loop?
0 Kudos
Message 4 of 5
(1,110 Views)

If you are using the Report Generation Toolkit, creating an Excel Worksheet that looks like this:


Easier to read in columnsEasier to read in columns

This is not difficult.  I did exactly this almost a decade ago (actually one Worksheet was organized by rows, and another, like the above, was organized by columns).

 

The following things are important for us to know in order to advise you how to proceed:

  1. The top part of your Worksheet is organized by rows.  The first column has the Label, the second column has the data.  Not difficult, but you need to know (and output) these data first in order to figure out where to start the second, column-organized data.
    1. We need to know the organization (including Font info) for the "Identifier Column" (A), including spacing if you leave blank spaces.
    2. We need to know how you fill in the second "Data" column (B).  It appears that Font info is not necessary, but numeric formatting might be (for example, date and time).
  2. For the second, column-organized data, there are similar questions.
    1. The first two columns all seem to be (fixed) identifiers.  We need to know how you specify these (I presume you have an array of strings for labels).  How about fonts and formats?  I don't recall (but could "look it up" how to do subscripts in Excel.
    2. I assume the later "data columns" are arrived at (and therefore written) one column at a time, with the number of columns depending on how many runs/tests you do.  Please clarify.
    3. When writing the Column, there is a Header (specify Font and formatting), a blank row, then an array of data ("matched" to the Identifier entries in Columns A and B).  Please clarify.  Is the desired formatting of all the data rows the same?  Are the data types in the rows all the same (I presume Dbl)?
  3. How often do you open/close the Excel Workbook?  Do you open a blank Workbook, write the top Row-oriented data, leave the Workbook open, write the Column-oriented headers, leave the Workbook open, write each Column-oriented data as it comes in, then close the Workbook?
  4. Alternatively, do you open a blank Workbook, write the Row-oriented data, write the Column-oriented headers, then close the Workbook, and as each set of Column-oriented data comes in, re-open the Workbook, add the next column of data, then close the Workbook again?

The difference between methods 3 and 4 have to do with how fast data comes in (use method 3 if fast) or how worried you are about a crash or error mid-way (use method 4, which only has a problem if the crash is during Excel I/O, not during data collection).

 

Bob Schor

 

P.S. -- I forgot to ask.  Are you, by any chance, using an Excel Template?  If so, you really need to attach the Template for us to examine.  It becomes a lot more "interesting" (= difficult and challenging) if the Template changes!

0 Kudos
Message 5 of 5
(1,073 Views)