Hi does anyone already made a tcl command to write down any signals from the wave into a CSV file (excel compatible) thanks for your help
jacky
Hi does anyone already made a tcl command to write down any signals from the wave into a CSV file (excel compatible) thanks for your help
jacky
It's rather easy to write a single CSV record in Tcl:
# First argument $file is a Tcl file handle # obtained from the [open] command. Second argument $arglist # is a Tcl list of the items in the comma-separated record. # proc writeCSVrecord {file arglist} { puts $file [join $arglist ,] }
And you can quite easily combine that with the [examine] command:
# Second argument $signals is a list of signal names # to include in the CSV record proc writeCSVsignals {file signals} { set values [list] foreach sig $signals { lappend values [examine $sig] # or ... lappend values $sig [examine $sig] # if you also want the signal name in the file } writeCSVrecord $file $values }
Now it's simply necessary to open a file for output, call procedure [writeCSVsignals] as many times as required, and finally close the file.
many thanks Jonatham have a great day
Have something to add? Share your thoughts — no account required.
Ask the community — no account required