From: Daniel Berger Date: 2005-07-15T00:48:39+09:00 Subject: Re: Help: very simple script problem Tristan Knowles wrote: > Hi, > > After reading up on Ruby I thought it sounded good and > decided to learn it so I can manipulate my files on my > linux server such as log, csv, conf etc. Anyway, i'm > a beginner when it comes to programming, so bear with > me. > > I use the Asterisk PBX and came across this script > here which reads a csv file and puts each record into > an html table: > http://rubyforge.org/snippet/detail.php?type=snippet&id=76 For simple tables, allow me to shamelessly promote my html-table package. # example table = Table.new("Call Records") table.width = "80%" IO.foreach(log_file){ |line| table.push(Table::Row.new(line.chomp)) } File.open("test_out.html", "w+"){ |fh| fh.puts(table.html) } That isn't exactly what you were trying to do with your example, but I hope you get the idea. Regards, Dan