Re: Is it possible to have special characters in list
- From: Andreas Leitgeb <avl@xxxxxxxx>
- Date: 03 Sep 2007 08:24:06 GMT
Larry W. Virden <lvirden@xxxxxxxxx> wrote:
On Sep 1, 1:03 pm, Andreas Leitgeb <a...@xxxxxxxx> wrote:
It seems like you were parsing a hexdump.
You just can't treat that as a list, not even simply
convert it, since the last "column" could just as well
contain characters that look like hexdata and/or spaces,
which would foul up your result.
You *have* to parse that line by line!
While I agree that one can't treat arbitrary strings as a list, that
doesn't mean that one has to hand parse the line if there is a need to
use list commands - just use Tcl's split on the line first.
You're right in the general case. There are situations where
a string can be easily "prepared" for proper list-parsing.
I'm talking about the special case of parsing a hexdump with that
plaintext-column. If you coerced that into a list, there'd be no
way to sensibly handle that list, just because the plaintext-column
might contain anything, including stuff that looks like data-columns
or even extra spaces, that will randomize the number of perceived
list-elements per line.
So, my comment about *having* to parse it line by line was more
targetted to the problem at hand (parsing that particular format),
than about Tcl's string-list-issue.
.
- References:
- Is it possible to have special characters in list
- From: Terminator
- Re: Is it possible to have special characters in list
- From: Andreas Leitgeb
- Re: Is it possible to have special characters in list
- From: Larry W. Virden
- Is it possible to have special characters in list
- Prev by Date: Re: Setting a palette for chosen widget (not widget type!)
- Next by Date: Re: Default options for "scale"
- Previous by thread: Re: Is it possible to have special characters in list
- Next by thread: Re: getting user names with twapi
- Index(es):
Relevant Pages
|