[ILUGC] : Tips-Learn Simple Ruby Scripting per day
ranjith.k at sedin.co.in
Wed Aug 25 16:53:45 IST 2010
Today we will learn how to read command line arguments in a Ruby
script. To can solve it by using the special Ruby array ARGV to get the
information you need.
To get the number of command line arguments passed in to your Ruby script,
check ARGV.length, like this:
# quit unless our script gets two command line arguments
unless ARGV.length == 2
puts "Dude, not the right number of arguments."
puts "Usage: ruby MyScript.rb InputFile.csv SortedOutputFile.csv\n"
Hi Balachandar muruganantham I`m not expert in ruby just a beginner but
anyhow I will try to find a solution for your issue and send it back to you.
More information about the ilugc