home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!agate!adrianho
- From: adrianho@barkley.berkeley.edu (Adrian J Ho)
- Newsgroups: comp.lang.tcl
- Subject: Re: insertion of non-formated strings
- Date: 13 Aug 92 13:38:14
- Organization: University of California, Berkeley
- Lines: 21
- Message-ID: <ADRIANHO.92Aug13133814@barkley.berkeley.edu>
- References: <1992Aug12.215321.2136@terminator.cc.umich.edu>
- NNTP-Posting-Host: barkley.berkeley.edu
- In-reply-to: normanb@citi.umich.edu's message of Wed, 12 Aug 1992 21:53:21 GMT
-
- In article <1992Aug12.215321.2136@terminator.cc.umich.edu> normanb@citi.umich.edu (David R. Richardson) writes:
- >What is the proper way to operate on strings that might not
- >be well formatted -- strings that might contain quotations,
- >braces, spaces, etc.?
-
- This question can be answered in several different ways, depending on
- the context. In your case, you're trying to operate on lines returned
- by a separate executable; you should take advantage of open's command
- pipeline capability, like this:
-
- set fp [open "|scan"]
- while {[gets $fp line] > -1} {
- .frame.list insert end $line
- }
- close $fp
- --
- -----------------------------------------------------------------------------
- Adrian Ho, He With The Embarrassingly *Dead* Passion ** Phone: (510) 642-5563
- System Manager, CFD Lab, ME Dept, UC Berkeley * adrianho@barkley.berkeley.edu
- Maintainer, Tcl/Tk Contrib Archive ---- barkley.berkeley.edu [128.32.142.237]
- Send all Tcl/Tk Archive-related stuff to tcl-archive@barkley.berkeley.edu
-