Я пытаюсь создать красивый отчет о файле CSV, который содержит:
,column_1, column_2,column_3,column_4
line_1,1,2,3,4
line_2,5,6,7,8
line_3,9,0,1,2
line_4,3,4,5,6
Вот мой код TCL:
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
lappend auto_path .../tcllib/
package require csv
package require struct::matrix
package require report
struct::matrix data
set f [open my.csv "r"]
csv::read2matrix $f data , auto
report::defstyle simpletable {} {
data set [split "[string repeat "| " [columns]]|"]
top set [split "[string repeat "+ - " [columns]]+"]
bottom set [top get]
top enable
bottom enable
}
report::report r 5 style simpletable
r printmatrix data
Когда я выполняю это, я получаю:
**report/matrix mismatch in number of columns**
Что я не так сделал?
Спасибо