Hi all, There is a library called OptionParser. That will be useful for handling the command line arguments in ruby.
On Wed, Aug 25, 2010 at 4:53 PM, Ranjith <[email protected]> wrote: > Hi all, > 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" > exit > end > > > 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. > Thank you > > > -- > Cheers, > Ranjith Kumar.K, > Software Engineer, > Sedin Technologies, > > http://ranjithtenz.wordpress.com/ > http://victusads.com/ > _______________________________________________ > ILUGC Mailing List: > http://www.ae.iitm.ac.in/mailman/listinfo/ilugc > -- Best Regards, R.Sasi, D.C.E., M.C.A. Associate System Engineer, Chennai. _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
