First convert arrays to lists:
set GOLDList "" set keyList [array names GOLD] foreach key $keyList { lappend GOLDList $GOLD($key) }
Then you can use the foreach snippet:
set GOLDList "1 2 3 4"; #1st list set TESTList "Hello Stack Guys TCL"; #2nd list set DIFFList "Hi Format for print"; #3rd list foreach c1 $GOLDList c2 $TESTList c3 $DIFFList { puts $c1\t$c2\t$c3 }
This is the result (you need to print an additional header)
1 Hello Hi 2 Stack Format 3 Guys for 4 TCL print
source share