Loops to compare many rows between 2 worksheets in C#?

  • Context: C# 
  • Thread starter Thread starter sweetjones
  • Start date Start date
  • Tags Tags
    C++ Compare Loops
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 4K views
sweetjones
Messages
44
Reaction score
0
Hello All,

I took it upon myself to create a tool for my job that xref 2 excel worksheets on 2 different workbooks. Customers send us parts and they're wanting the leadtimes for them. We have a weekly report that has all part numbers with their leadtimes. My goal is to create a GUI in C# that my team can copy & paste the customer's requested part numbers into a control, then click a button that generates a new excel file with those pasted parts in the 1st column. While simultaneously have the weekly report opened in the background. Compare each row of customer parts with the weekly report and if there's a match, provide it's respective leadtime number in column B. The only thing I have figured out so far is to open the workbooks and name the worksheet.(whoopty doo)

My issues so far:

1. What control to use in my windows form that can hold a varying number of part numbers? I know a rich textbox has limits. The number of parts a customer sends us vary. One could send in 50 part numbers, and someone else could send 2000 parts.

2. What type of loop should be used to compare 2 columns on 2 different worksheets, and provide their respective row of info?


In theory this seemed pretty straight forward and not that difficult, but it seems like working with Interop.Excel gets pretty messy. Looks like I've dug myself a deep hole. I would really appreciate any input that you may have.

Thanks in advance!
 
Physics news on Phys.org
Hi

my question is if there are any other free flex-paced similar online courses to Freecodecamp that give out a certification at the end of the course. I've been using FreeCodeCamp (www.freecodecamp.com) for a few weeks now. I love it. My question is if there are any other similar online free flex-paced computer programming classes that give out a certification at the end of the course. Thank you.
 
I have a large C program running under Qnx7. It does a lot of stuff: TCP, terminal and file IO, Qnx messaging, etc., but none of which is relevant to my question.

Been chasing down a bug in the C library read() function which intermittently returns bad data with no error indication (a 2nd read from the same file offset usually returns the correct data). To try to track it down I trap and pass all calls to the C lib read() through my own identically prototyped read_wedge() function, which fills the passed buffer with repeated calls to read() of some maximum number of bytes. If this max value is 16 or less, the program runs fine for days. At 32 if failed after 20 hours of pounding. At 256 it fails in relatively short order. The larger this number, the more likely read() is to fail it seems. I've learned over the years that blaming the OS is not conducive to finding bugs. But, and this is my question, this has to be the OS, right? (I'm thinking either interrupts or caching.)
 
Hi at all!

I need to insert a matrix in another bigger one using Boost library. An example:
I have a matrix A (3x3) and i want to insert it into an identity matrix B (4x4) in this way

matrix_block.jpg


This is my code:
C++:
boost::numeric::ublas::matrix<double> A(3,3);
boost::numeric::ublas::identity_matrix<double> B(4,4);

for (unsigned int i = 1; i < B.size1(); ++i)
{
    for (unsigned int j = 1; j < B.size2(); ++j)
    {
        B(i, j) = A(i - 1, j - 1);
    }
}

Is there a better way to do this using Boost library?

Thanks!