Re: extract hostnames
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Sep 2006 11:10:32 GMT
Michael A. Cleverly wrote:
On Thu, 28 Sep 2006, tom wrote:
im looking for a script that can extract hostnames from a
list(txt,html) like this:
the-roadside.com 3 43197 1( 0)
202.218.17.12-OK
[etc...]
set hosts [list]
set fp [open path/to/the/file]
while {[gets $fp line] != -1} {
lappend hosts [lindex $line 0]
}
close $fp
puts $hosts
Michael
That only works if the data is guaranteed to be a well-formed series of newline separated tcl lists. Real world data is notorious for being ignorant of that requirement.
--
Bryan Oakley
http://www.tclscripting.com
.
- Follow-Ups:
- Re: extract hostnames
- From: Michael A. Cleverly
- Re: extract hostnames
- References:
- extract hostnames
- From: tom
- Re: extract hostnames
- From: Michael A. Cleverly
- extract hostnames
- Prev by Date: Re: possible to control activesync via tcom?
- Next by Date: Why second and next source calls are slower than first one?
- Previous by thread: Re: extract hostnames
- Next by thread: Re: extract hostnames
- Index(es):
Relevant Pages
|
|