I have a result set that I am returning from a result set. I am wanting to turn that into a matrix object to perform in memory lookups on the data. I have never used Matrix and am stuck on getting it to work. Can anyone provide an example?
2 回答
0
add row
据我所知,直接使用矩阵的方法可以避免通过 CSV 的行程。
::struct::matrix Mtrx
Mtrx add columns [llength [$SQLResultSet columns]]
while {[$SQLResultSet nextlist Return_Row]} {
Mtrx add row $Return_Row
}
于 2018-12-01T07:41:06.887 回答
0
我想到了:
::struct::matrix Mtrx
Mtrx add columns [llength [$SQLResultSet columns]]
while {[$SQLResultSet nextlist Return_Row]} {
::csv::split2matrix Mtrx [::csv::join $Return_Row] {,} {expand auto}
}
从这里你可以做你需要的。
于 2018-11-29T17:53:18.747 回答