Skip to content

Instantly share code, notes, and snippets.

@cmosguy
Created March 14, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmosguy/c71fcd7e09ed33d738f1 to your computer and use it in GitHub Desktop.
Save cmosguy/c71fcd7e09ed33d738f1 to your computer and use it in GitHub Desktop.
puts "Loading BHAB Parser"
package require csv
package require struct::matrix
catch {
#doing a lot of reloading on the data matrix
#need to delete the data command before issuing the
#struct command again
rename data {}
}
::struct::matrix data
proc parseB5evCsv {csvFile} {
set chan [open $csvFile r]
csv::read2matrix $chan data , auto
close $chan
set rows [data rows]
for {set row 0} {$row < $rows} {incr row} {
if {$row == 0} {
set title [lindex [data get row $row] 0]
puts "Title: $title"
}
}
return [list $title]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment