LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

(string array indexing)

David,
 
Wish you a Happy Thanksgiving. I'm on a vacationSmiley Happy and will get back to you next week with a couple things that I need help with.  
 
You have a wonderful day.
 
Regards
 
Shaun
0 Kudos
Message 21 of 36
(2,581 Views)

Hello David,

Hope you had a nice Thanksgiving. And I'm back to work after a nice vacation.

Alright, I have an excel file here that I'm having trouble reading. I'm using ActiveX to read the spreadsheet and it works fine with other spreadsheets except for this one. I can read the same file contents from other excel sheets. Tried changing the extension(to .xls) and reading it without any luck. Is there any way I can read this type of excel file like any other spreadsheet...?

Secondly,  I'm having 2 2D arrays. I would like to compare the first frist 4 columns of both the arrays. Like first four column elements of first row(1st array) with first 4 column elements of all the rows in 2nd array..., first four column elements of second row(1st array) with first 4 column elements of all the rows in 2nd array and so on.. If they match I want the corresponding rows(with all elements) from both the arrays to be pulled out as a 1D array and build a 2D array for all the matches. I would like to know the best way to do it. I greatly appreciate your help.

 

Thank you very much

Have a wonderful night

Shaun

 

 

 

0 Kudos
Message 22 of 36
(2,559 Views)

Thank you! Unfortunately I had to work as we don't celebrate Thanksgiving here in Scotland but its good to hear you had a good holiday none the less. Any way moving on ...

Sorry, I don't know why you can't read the xls file but that doesn't stop us having a look at it. I noticed that the excel spreadsheet has a macro. Does that make this xls file different from the others? If so it could be your Macro Security is set very high. If you post the code you use to read the xls file you posted I could take a look at.

You can compare two 2D arrays using the Equals? in comparison palette. It will return a 2D array of booleans that will contain True in each index that match in both arrays.

Message 23 of 36
(2,546 Views)

Hello David,

I didn't know you were from Scotland. Home of the Brave Heart..!( as the movie depicts). How is the weather like over there..? We are have a snow storm out here..!

I'm attaching the vi i'm using to read the my macro enabled excel file. Please have a look and let me know if there's any changes that I have to make in the "Excel Get Data Specified Field.vi" to be able to read excel file that I have. 

And also attaching vi I was able to make for array column comparison(Row match.vi). I'm kinda stuck at dynamic indexing the matched rows and building an array in the required format. An example that shows the requirement is as shown in the word document. I would be thankful if you can correct my code as per my requirement.

Thank you

Have a Nice Day..!

Shaun

0 Kudos
Message 24 of 36
(2,507 Views)

Good movie! Really dodgy accent though.  The weather here has been wild, wet and windy but mild for the time year according to bloke who does the weather on the telly.

Your VI to get the data from excel was broken in a couple of places (Open invoke, and you need to use Value2 and ot Value) so I fixed that. You will need to be carefull about closing activex references in the reverse order you create them. This VI locks access to the file that was opened and read using your VI so that might be your issue. I needed to exit labview to access the excel file again. So thats something for you to look at.

I have attached a VI to do the row matches for you. It would have been helpful if you supplied a VI with data already in the tables.

David

Download All
Message 25 of 36
(2,495 Views)
 
 
Hello David,
 
It's 12 days to Christmas..! Feel like this holiday season should last forever.. Smiley Happy. Hope it doesnt snow too much this time.
 
Ok.., moving on..., The circuit "Row Match 2.vi" works fine for single occurances of a "row match" in the second table. But, I would also like to have the composite rows for multiple row matches in the second table. Could you kindly modify the circuit accordingly
 
Secondly, I would like to know if there is a "master" code that can read any excel file irrespective of its level of security( macro enabled). If so I really appreciate if you can post the code for me.
 
David, you are helping me a lot my friend..! Let me know if I can do anything for you....,
How about a nice Christmas gift ...?Smiley Very Happy
 
 
Thanks
 
Have a nice night
 
Shaun
 
 
 
 
0 Kudos
Message 26 of 36
(2,451 Views)

Hi Shaun

Sorry I haven't been back to you sooner as I have been away on business.

I see you have started a new thread here http://forums.ni.com/ni/board/message?board.id=170&message.id=220599 and received some more help from the boys in blue.

If you don't get an answer within reasonable time to your current thread then by all means "bump" it to bring it to the top for attention. I think this is better than starting a new thread on the same subject. That way when you bump the thread up the community can see the history of your questions to help you better.

On the subject of modifying the VIs with your requirements. So far I have given you plenty of detailed help so far to get you started. I was actually hoping you would be learning something along the way and be able to make the modifications yourself. If I keep doing the work for you then I feel you won't learn anything.

Is there any aspect so far that you are not sure about?

About your question on opening excel files with macro security level set very high. My earlier reply was just a hunch so I just tried Excel Macro Example.vi with Excel Macro Security Level set Very high with no issues so it might be something else causing your issue when opening your file.

I am very happy to help you along the labview journey but not do the all the work for you.

Happy Holidays!

David

Message 27 of 36
(2,411 Views)

David,

Sorry if I've annoyed you by starting a new thread.  I sincerely appreciate all the help you have given me and I'm very thankfull to you aswell.

Happy Holidays

Merry Christmas

Shaun

0 Kudos
Message 28 of 36
(2,387 Views)

Thanks Shaun.

Me! Smiley Surprised  Annoyed? Smiley Mad No way! Smiley Tongue You have absolutely nothing to apologise for. It was just some advice on how to get the best learning experience from the forum.

All the best!

David

Message 29 of 36
(2,383 Views)
Happy New Year David. Hope you had a good new year's day. I met a "Scottish" person recently and was surprised to see her accent sound soo much like ours.., rolling of r's, stressing 'd's and 't's' and everything. I bet you won't have any problem understanding anyone if you were to visit here.
 
I am almost done with everything except for the row matching part. I need some help in knowing how to modify the rowmatch2.vi. I would like to know the necessary modifications to get the row pading for multiple matches (of 1st 4 column elements) in the second table.
 
Thank you
 
Have a nice day..!
 
Shaun
 
 
0 Kudos
Message 30 of 36
(2,328 Views)