Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tcl 指向包含矩阵的CSV文件的标题_Tcl_Tk - Fatal编程技术网

Tcl 指向包含矩阵的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

我的应用程序使用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::writematrix $matrix $outfile
close $outfile

请显示代码的相关位在矩阵顶部插入(标题)行?在关闭文件句柄之前,先写一个单独的一行匹配列数矩阵(包含标题),然后像现在一样写数据?最明显的可能起作用的是什么?