LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to merge 2 excel page set of 2 different program

Good morning all,

 

I have a project taking several labview programs, each labview program saves an excel page, I would like to know if it is possible in a program to resemble the new page with the one from before

 

explanation: program 1: first and last name is displayed and saved on an excel page

program 2: height and weight displayed on an excel page

objective: combine the excel sheet of program 1 with the excel sheet of program 2 to obtain at the end a sheet an excel sheet with the data from program 1 and the data from program 2

0 Kudos
Message 1 of 10
(2,097 Views)

Hi thib,

 


@thib101200 wrote:

I would like to know if it is possible in a program to resemble the new page with the one from before


Yes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,093 Views)

how can we do ?

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

Hi thib,

 

read both Excel sheets, then save the data into one sheet.

 

When you are using real Excel files (like XLSX) then you need to use RGT functions.

For CSV files you can use simple "Delimited text" file functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(2,078 Views)

do you have an example that i understand how to read 2 excel sheet then save the data on 1 single sheet

 

 

0 Kudos
Message 5 of 10
(2,063 Views)

Hi thib,

 

LabVIEW comes with a huge example library, and there are also examples on using RGT to handle Office documents.

Just learn from them!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(2,057 Views)

One of the things that GerdW mentioned is the need to distinguish between Excel data, meaning files with the extension .xls or .xlsx, and what LabVIEW calls a Delimited Spreadsheet, a text file with a character (typically a comma or a tab) separating Columns and Rows saved as separate lines of text -- such files typically have the extension .csv (for Comma-Separated Values), and if you have Microsoft Office installed, these files will have a default Icon that "looks like" Excel, even though it is a pure Text file.

 

Working with .csv files is easy in LabVIEW.  Read Delimited Spreadsheet imports the data as 2D arrays, and Write Delimited Spreadsheet outputs it.  If you have two such arrays, you can combine them any way you want and write out a single Array.

 

If you truly have Excel (.xlsx) files, there's a bit more work to do.  The New Report function takes a "Template" input, which is essentially an "Open for Reading" (though you'll have to do a bit of work to extract the data).  Once you have extracted the Data, you can combine it with other data and create a new Report, giving the Report a new Filename.

 

Bob Schor

0 Kudos
Message 7 of 10
(2,035 Views)

thank you so much

my excel file is in (xls) how do I extract the data?

0 Kudos
Message 8 of 10
(2,031 Views)

Hi thib,

 


@thib101200 wrote:

my excel file is in (xls) how do I extract the data?


As has been mentioned several times before: use RGT (ReportGenerationToolkit) functions to read your XLS files…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(2,028 Views)

Extracting the data requires some work.  There is an Excel Get Data function, but it really helps to know precisely the format of the Excel file you are trying to read (and/or parse).

 

This is something that I would not recommend to someone with less than several months of real LabVIEW experience ...

 

Bob Schor

0 Kudos
Message 10 of 10
(2,020 Views)