43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
}
# Allow backslash for easy access to \t
set opts(-sep) [subst -nocommands -novariables $opts(-sep)]
# If any column is given by name, assume the file starts with
# a header line of column names
foreach col [concat $opts(-csvignore) $opts(-csvkey)] {
if {![string is integer $col]} {
set opts(-csvheader) 1
}
}
if {$opts(-csvheader)} {
set nameLine [gets $chi]
# Keep it first in file
puts $cho $nameLine
|
|
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
}
# Allow backslash for easy access to \t
set opts(-sep) [subst -nocommands -novariables $opts(-sep)]
# If any column is given by name, assume the file starts with
# a header line of column names
foreach col [concat $opts(-csvignore) $opts(-csvkey)] {
if { ! [string is integer $col]} {
set opts(-csvheader) 1
}
}
if {$opts(-csvheader)} {
set nameLine [gets $chi]
# Keep it first in file
puts $cho $nameLine
|