From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge multiple columns in 2D array

Hi, I am importing the data into LabVIEW. However, some data occupy 2 columns but when it is imported into LabVIEW it only shows in one column and the other column is empty. Is there a way for me to merge multiple columns in a 2D array? You can use the excel file as a sample. 

My code: 

elliot97_0-1586399741589.png

 

The array I got is not the same as the excel file.

elliot97_0-1586399324602.png

 

Download All
0 Kudos
Message 1 of 8
(2,303 Views)

I don't understand your question or how it relates to LabVIEW.

It would have been helpful if showed your LabVIEW code you claim is doing the importing.

 

What I do see in your XLS file is that you have columns merged.  But how you are importing and how you expect the results to be are missing in your question.

0 Kudos
Message 2 of 8
(2,291 Views)

I expect my result to be the same as the excel file but I got different array when I imported. 

0 Kudos
Message 3 of 8
(2,286 Views)

Where is your VI?

 

You haven't shown us how you "imported" it.

 

I don't know of any "Import Excel" function in LabVIEW.

0 Kudos
Message 4 of 8
(2,281 Views)

I used the New Report.vi from Labview to import data from Excel. I just attached my code in my post.

0 Kudos
Message 5 of 8
(2,276 Views)

What do you expect?   It sounds like you expect 3 15's in that 4th row?  Why?

 

There is only on 15 in that row.  It exists in Cell C4.  Cells C5, C6 don't have any data in them.  They can't have any data in them.

The data doesn't "occupy" two columns.  It is only in one cell.  It is a visual effect Excel does to stretch the appearance of that cell across multiple cells.

 

It is like you are expecting LabVIEW to treat spreadsheets differently than the way Excel treats them.

0 Kudos
Message 6 of 8
(2,252 Views)

oh, I see then is it possible to place three 15 in 4th row of the array instead of one 15 while the others are empty?

0 Kudos
Message 7 of 8
(2,245 Views)

Why are you messing around with merged cells?

 

If you want to put 3 15's in there, then you need to figure out how to know C4 is merged with C5 and C6, get the value of C4, and replace the values in C5 and C6 with that value.

 

What you are trying to do here is very strange.  What are you actually trying to do with this Excel file?

0 Kudos
Message 8 of 8
(2,225 Views)