Tcl 指向包含矩阵的CSV文件的标题
我的应用程序使用CSV::writematrix$matrixname$文件生成包含矩阵的CSV。这仅将我的矩阵打印到CSV文件。如何在每次写入此csv文件时为其添加标题Tcl 指向包含矩阵的CSV文件的标题,tcl,tk,Tcl,Tk,我的应用程序使用CSV::writematrix$matrixname$文件生成包含矩阵的CSV。这仅将我的矩阵打印到CSV文件。如何在每次写入此csv文件时为其添加标题 set outfile [open "$csvfile" w] set template [path/to/template/for/matrix/file.csv] #populate the template with data set matrix [loadmatrix $template] csv::writemat
set outfile [open "$csvfile" w]
set template [path/to/template/for/matrix/file.csv]
#populate the template with data
set matrix [loadmatrix $template]
csv::writematrix $matrix $outfile
close $outfile
请显示代码的相关位在矩阵顶部插入(标题)行?在关闭文件句柄之前,先写一个单独的一行匹配列数矩阵(包含标题),然后像现在一样写数据?最明显的可能起作用的是什么?