This is a demonstration of taking a flat file that is separated by some
character and formatting the data into a table. This makes use of the
Tcl open command. The open command in NeoWebScript is a restricted
version of the regular open command. It allows the user's interpreter to
open files which are only in the current directory.
set fp [open prices.txt]
html ""
while {[gets $fp line] != -1} {
set info [split $line "|"]
html ""
foreach item $info {
html "$item"
}
}
html |
Here are the contents of the data file (or you can
download it directly):
include_file prices.txt
Also, click here to view
maketable.nhtml file as text.