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

<snip>

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