in reply to Comparing array contents to DB contents

What would happen if on a per record basis you concatenate all fields in the Database and do the same for the fields in your table and then compare both strings against each other?

I may have missed something, though. Why are you using the String::Approx module?

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Update: Changed "String::Compare" to "String::Approx"
  • Comment on Re: Comparing array contents to DB contents

Replies are listed 'Best First'.
Re: Re: Comparing array contents to DB contents
by castaway (Parson) on Jan 30, 2003 at 12:04 UTC
    Hmm, might be an idea..
    I'm using it because I'm trying to clean up the data as I go.. theres quite a big possibility of similar names being written differently/mistyped (eg 'MudOS', 'MudOD', 'Mudos' are probably all the same thing.)

    Though I've not figured out yet how tolerant it is, this is just playing around at the mo..

    C.

      If it is just a matter of UPPERCASE v. lowercase, you can force both strings to lowercase and then do the comparison.

      Did you already have a look at Array::Compare? Incidentally, the simple compare method also uses "my" concatenation trick.

      Having had a quick peek at String::Approx I think it can be used with this concatenation trick: rather than test on eq you test on adist or adistr and see if both strings are sufficiently equal to be accepted as such or must be checked further.

      String::Similarity might also be a good candidate: it seems simpler than String::Approx.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law