From: "Mehr, Assaph (Assaph)" Date: 2004-08-05T10:29:19+09:00 Subject: Re: open files in other directories > Thank you very much. As a ruby noob I am still learning the built in methods. > I didn't even think to use glob. No worries - that's what this list is for :) It just hit me: >> campershash["#{textfilename.chop.chop.chop.chop}"] = >Try textfilename[0..-5] for a fixed size slice. You're probably trying to remove the extension. Take a look at File class methods: basename, extname, dirname etc. You can strip extension by: base_name = textfilename.delete File.extname(textfilename)