From: Peter Szinek Date: 2006-12-06T20:49:54+09:00 Subject: Re: Newbie: working with a text file and converting to xml Adam Teale wrote: > Hi Peter, > > I saved your code and called it convert.rb. I ran it (replacing > 'filename' with the path of my text file - was that right to do?) > > i got this error: > convert.rb:1: unknown regexp options - atal > > any ideas? I guess you are referring to Paul's solution since I did not use any files :) In any case, could you paste the code here (convert.rb) so I can check what's going on? > also, do you know if thereis any way to run a script from the > commandline like?: > ./convert.rb mytextfile.txt Sure. The array called ARGV contains all the command line options. ------ test.rb #!/usr/bin/ruby puts ARGV[0] puts ARGV[1] ------ ./test rb foo bar will output ---- foo bar ---- Cheers, Peter __ http://www.rubyrailways.com