From: Robert Klemme Date: 2010-05-12T00:01:39+09:00 Subject: Re: Problem renaming files 2010/5/11 Jesús Gabriel y Galán : > On Tue, May 11, 2010 at 4:27 PM, Jacob Davis wrote: >> Jesús Gabriel y Galán wrote: >>> On Tue, May 11, 2010 at 5:10 AM, Jacob Davis wrote: >> So, I should remove the .to_s so that it will populate the multiple >> names into an array correct? > > Yes, if you do > > file_names = ARGV.dup > > you get an array of file names. Then you can iterate through that > array doing the operation to each of them: You do not even need to #dup because ARGV *is* an Array already. $ ruby19 -e 'p ARGV.class' Array > # Have user input build number to be removed > puts "Please enter the build number you wish to be removed from the > file" > build_number = STDIN.gets.chomp.to_s > > # Have user input version number to be appended to file name > puts "Please enter the version number you wish to be appended" > version_number = STDIN.gets.chomp.to_s #to_s is not needed but checking the input is probably also a good idea. You could simply do version_number = STDIN.gets.chomp Integer(version_number) # will throw if not numeric Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/