From: Johnathan Smith Date: 2007-12-04T00:57:03+09:00 Subject: read file and print contents - beginner hello, im new to ruby and i have a text file and want to read in the file and print it out. so far iv got the following. I'd greatly appreciate any help. thanks. text file (reference.txt): Tag: ref1 Type: Book Author: Little, S R ruby file: #!/usr/local/bin/ruby # # # read file and print # ARGV.each do |fn| begin (fn == '-' ? STDIN : File.open(fn)).each_line do |l| if $indent > 0 (1..$indent).each { print ' ' } end puts l end -- Posted via http://www.ruby-forum.com/.