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: 

Read data from excel and add to another excel file without replacing

What i am trying to do is find a string then go to the next column of same row and read that value. Since i need to find more than one string, i have added separate functions for each string in flat sequence. And all the found values combined together to write in excel.

 

 

Do you think there is a better way to do this ?

 

 

 

0 Kudos
Message 11 of 19
(877 Views)

Yes there are better ways to do it. All the excel functions are exactly the same except for the string to find. Create a subvi of the Excel functions and the inputs to the subvi will be Error in and the string to find and the outputs will be the error out and the data. Then just use the subvi in your main vi and use dataflow withe the error in and out. then write to the file at the end. that way there are no long sequence structures and wires going back and forth across the screen. A good rule of thumb about using subvi's is if you use a function more than once then you need to make a subvi for the function. If you do not know how to use subvis then I would suggest going through the examples.




Joe.
"NOTHING IS EVER EASY"
Message 12 of 19
(874 Views)

 also if you know which column the data is in and it is the same all the time then you do not have to use the find function. You just put in the cell # itself. Looks like to me everything will always be the same.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 13 of 19
(873 Views)

Many Thanks for suggestions i will look into those!!

The reason why I am using find function because the data generated from instrument is always in the same column but rows are different all the time.

Can you explain a bit on # function you mentioned ? 

 

0 Kudos
Message 14 of 19
(870 Views)

Not sure what your talking about. # is shorthand writing for the word "number".




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 15 of 19
(867 Views)

well I was not aware of that terminology.

But can it help in case the row numbers are changing ?

when there are more than one values to be read ?

0 Kudos
Message 16 of 19
(864 Views)

Try putting your Excel functions in a subvi and when you get that done I will help you further.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 17 of 19
(861 Views)

thanks

i will get back to you soon

0 Kudos
Message 18 of 19
(857 Views)

So here is the sub vi which finds the value next to string. It will find the value for the string from the given excel file.

The search strings are e.g. CDi,CMono,H2,AGON,CH4 etc.

 

Thanks !

In this way i could cable to learn sub vi

Download All
0 Kudos
Message 19 of 19
(852 Views)