tcl to excel
Hi all,
Can we write tcl variables to a excel file.
Thanks ,
Mahes
Answers
-
Hi Mahes,
Can you please elaborate on this, what variables are you trying to export as csv?
0 -
Hi George,
for example I have a comp id 1
I wanna get the info about the component and write to a excel file.
Thanks,
Mahes
0 -
Hi
Switch model browser to 'component view' mode, right click on browser and select 'export' to csv file
Or, in utility tab, click 'component table' and select File > export to csv file
0 -
Hi tinh
I need to do in macro...the above thing is just a example.
Thanks,
Mahes
0 -
Ok it is like this
set fpt [open c:/sample.csv w]
fconfigure $fpt -encoding uft-8
puts $fpt 'comp id,comp name,thickness'
foreach compid {1 2 3 4 5} {
puts $fpt '$compid,[hm_getentityvalue comps $compid name 1 -byid],[hm_getthickness comps $compid]'
}
close $fpt
You should use csv package with commands ::csv::join and ::csv::split to handle strings with special characters
0 -
Altair Forum User said:
Ok it is like this
set fpt [open c:/sample.csv w]
fconfigure $fpt -encoding uft-8
puts $fpt 'comp id,comp name,thickness'
foreach compid {1 2 3 4 5} {
puts $fpt '$compid,[hm_getentityvalue comps $compid name 1 -byid],[hm_getthickness comps $compid]'
}
close $fpt
You should use csv package with commands ::csv::join and ::csv::split to handle strings with special characters
Thanks tinh.
I will try thiz champ
0 -
0
-
No, you don't.
it is for case you have unicode characters in data, example compnáme
0 -
Thanks tinh..
0