This solution is not the best, but it works. There may be corner cases that you need to observe. It does not require changing items in the list and does not need a CSV package.
set theList [list "21" "Some test" "Some test"] set quotedCSV "\"[join $theList {","}]\"" puts $quotedCSV
Basically, quotedCSV = quote + ( theList, separated by quote+comma+quote ) + quote . My suggestion is to go with CSV if you really don't need quotes.
source share