in reply to comparing array values or?

always vague questions are posted by some people

Here's a scenario. you're half way through it..
I assume that only one file has the multiple values of another.
you can get the lists from the first file, and stuff them into an array.. then you take the values of the second file and put into a hash of arrays and do your matching/comparing

I can't be more specific without some details, like :

  1. how is your file formatted?
  2. an example of the files/values..
  3. some code to begin with.

Chady | http://chady.net/

Replies are listed 'Best First'.
Re: Re: comparing array values or?
by Anonymous Monk on Mar 14, 2001 at 02:07 UTC
    Sorry about the vagueness, I tend to do that when I'm new to a task. To answer your questions:


    1. both files are comma delimited files.
    2. file1 fields= id,name,type
    file1 values= 1,yeates,scarborough
    2,wayman,freedom
    3,xena,princess

    file2 fields= name,ref#,organization,type,box#
    file2 values= wayman,34,meade,B1,4
    wayman,56,gs,B2,7
    wayman,78,nine,B3,8
    yeates,52,sample,A1,9
    xena,63,tv,C1,7
    xena,22,media,C2,2

    3. Right now the only code I have is reading the files into a string. That's all I've got because I want to figure out the best way to do this. File1 will be very small..100k. File2 will be larger than 40megs.

    Does this clarify some vagueness?

    Thanks.