Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^6: Looking up elements of an array in another array!

by better (Acolyte)
on Mar 15, 2013 at 21:34 UTC ( #1023782=note: print w/replies, xml ) Need Help??

in reply to Re^5: Looking up elements of an array in another array!
in thread Looking up elements of an array in another array!

Hi 2teez,

thanks for checking! The positive results you made, made me wondering, why it wouldn't work for me. Starting point of my doubts was, that the matching of array elements worked, if I defined the @ds inside the srcipt. Could there something be wrong with the text file? I created the list of IDs by copying a coloumn out of an excel worksheet into a notepad file. After I created another text file with perl, Kenosis' script worked somehow. However, it printed the Id.numbers of the refering text file, not the matches of the directory scan.

What I want to achieve is:

1.) Look up the Ids given in a text file:

I C 7700

I C 7711


2. Scan a directory and return all filenames containing the IDS

I C 7700 -A.jpg

I C 7700 -B.jpg

I C 7700 a,b -KK


And 3. (I haven't mentioned yet) Copy the matched files into another directory

My original script with that text file created by perl did all three steps, but with the last element of the @ds only. Why the other files were not detected and copied, I don't know

Ok. I will turn now to your next answer


  • Comment on Re^6: Looking up elements of an array in another array!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023782]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2016-10-28 20:39 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.