If there aren't any issues with needing to re-format any of these and you
just want to do a straight comparison, I would do it right in excel. If
you have the first file values in column A, and the second file values in
column C you could use something like this:
- If cell A1 has the first barcode from the first file, in cell B1
type: =Countif(A1,C:C)
- This is saying, count how many times the value in cell A1 shows up in
the array of column C (i.e. your second barcode list)
- This will return a number
- You can copy this formula down column B and it will execute for
each individual value, A2, A3, A4, etc.
- The result will give you a column that tells you either:
- 0 = the value does not show up anywhere in your second file list
- 1 or more = the value DOES show up in your second file list
The result should be a column that lets you identify anything from file 1
that also shows up in file 2. there are a bunch of different excel
formulas that would do the same thing but Countif is pretty friendly
syntax-wise so I like to stick with that.
On Fri, Nov 10, 2017 at 5:00 PM, Rogan Hamby <[log in to unmask]>
wrote:
> If they’re strings and you’re a *nix user I’d export them to files, sort
> them and use the comm command to generate a list of common values.
>
> On Fri, Nov 10, 2017 at 16:17 Kyle Breneman <[log in to unmask]>
> wrote:
>
> > I have 2 Excel files, each with a column of barcodes. I am supposed to
> > determine which, if any, of the barcodes in the first file are also
> present
> > in the second file. Is writing a short Python program the best way to do
> > this, or is there a more efficient way? (There are about 300 items in
> the
> > first file and about 1,000 items in the second file.)
> >
> > Regards,
> > Kyle
> >
> --
>
>
> Rogan Hamby
>
> Data and Project Analyst
>
> Equinox Open Library Initiative
>
> phone: 1-877-OPEN-ILS (673-6457)
>
> email: [log in to unmask]
> web: http://EquinoxInitiative.org
>
|