From: Adam Teale Date: 2006-12-06T21:28:48+09:00 Subject: Re: Newbie: working with a text file and converting to xml doh! Sorry guys! Peter - thanks for the ARGV tips! I think i have Paul's script going using the ARGV --------------------------------------------------- #!/usr/bin/ruby -w data = File.read(ARGV[0]) output = "\n" data.each do |line| timecode,subtitle = line.strip.split("\t") xml = "#{timecode}#{subtitle}" output += xml + "\n" end File.open("output.xml","w") { |f| f.write output } --------------------------------------------------- However it only outputs the first line from my txt file: --------------------------------------------------- 00:00:30:13Swayambhunath Temple: building started 460AD 00:00:42:21 --------------------------------------------------- Apologies for my newbieness! Cheers guys! Adam -- Posted via http://www.ruby-forum.com/.