in reply to Re: Re: Re: duplicate lines in array
in thread duplicate lines in array

That is exactly what I'm trying to achieve. Although I already have all the lines of data stored in @contact_type.
All I need to do is iterate over @contact_type and check for the defind pattern and print if any are repeated.
Can the code you have provided be changed to do that ?
<br.cheers harry
  • Comment on Re: Re: Re: Re: duplicate lines in array

Replies are listed 'Best First'.
(Re:)* duplicate lines in array
by pelagic (Priest) on Jan 27, 2004 at 13:00 UTC
    Harry,
    when you already have all the lines in @contact_type, you have no information ready about the source of your lines. (i.e. what file did it come from)
    do you care about that?
    If yes I'd suggest to change the reading through the files to a similar way I did it.
    If no, tell me ...
    Imre
      All the files have been opened and the lines of data have been stored in @contact_type.
      All I am looking to do something like this:
      foreach (@contact_type) { ...check for repeated data in @contact_type; ...print it out;
        Sorry, it's still not clear enough for me:
        All lines of all files are in just 1 array (@contact_tape).
        How do you know, what file the lines came from originally?
        What EXACTLY is the content of your array?
        Looping through the array you MUST somehow realise the moment you change from lines of one file to lines of the next file ...
        Imre