| Description: |
I am trying to use ::csv::split2matrix with | as the
separator char.
set trec "REC|DPI|AD1|AD2|AD3"
set sepchar "|"
set line [::csv::split $trec $sepchar]
puts $line
- -----> {"} {} {"REC} DPI AD1 AD2 AD3
set trec "REC,DPI,AD1,AD2,AD3"
set sepchar ","
set line [::csv::split $trec $sepchar]
puts $line
- -----> REC DPI AD1 AD2 AD3
|
| User Comments: |
andreas_kupries added on 2003-04-01 05:39:33:
Logged In: YES
user_id=75003
I found the reason for the behaviour. csv::split internally uses
regular expressions for its parsing, and | is a special
character for the regex engine. So is + for example, or *.
These characters fail too (extended the testsuite and tried
many separator characters). The sep char has to be
protected from special interpretation.
Fixed in CVS head.
|