From: Robert Klemme Date: 2009-05-14T04:15:02+09:00 Subject: Re: Newbie-Script for copying matching files to new destinat On 13.05.2009 20:43, Os Ai wrote: > Robert Klemme wrote: >> On 13.05.2009 19:21, Os Ai wrote: >>> Being new to Ruby,am not sure if it can do these but if it can then >>> someone please help.My challenge is that I want to copy certain files >>> from a source location with filenames containing words listed in a text >>> file to a new location. Any help would be most appreciated.Thanks in >>> advance. >> I am not sure what you are asking for... How about: >> >> 1. read words from file >> 2. enumerate all files in the source location and check each name for a >> match >> 3. if there is a match copy the file from source to target > Yes you got it. I guess you know how to speak 'programming' which I > obviously don't.So how do I go about it? Assuming you are completely new to programming you probably want to start here http://pine.fm/LearnToProgram/ or with any other introductory tutorial for Ruby and then look up documentation about these core and standard library classes String Array File Dir Find You'll find it here http://www.ruby-doc.org/core-1.9/index.html and http://www.ruby-doc.org/stdlib/. You can also find some hints about file reading in our blog, although I suggest you first consider Chris's book: http://blog.rubybestpractices.com/posts/rklemme/001-Using_blocks_for_Robustness.html Kind regards robert