View Single Post
  #29 (permalink)  
Old 01-15-2009, 06:43 PM
edraven's Avatar
edraven
Lurker
Offline
 
Join Date: Aug 2007
Posts: 16
Reputation: 5
edraven is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

That'd probably be better, but if you change your mind, I just finished the script. This uses TCL.

#!/usr/bin/tclsh

set f [open allutlzd.txt r]

puts "Windows Registry Editor Version 5.00"

while {[gets $f line] != -1} {
set field [split $line "\t" ]
set tmp [split [lindex $field 1] -]

set state [string trim [lindex $field 0]]
set areaCode [string trim [lindex $tmp 0]]
set prefix [string trim [lindex $tmp 1]]
set company [string trim [lindex $field 3]]
regsub -all {"} $company {} company
set rateCenter [string trim [lindex $field 4]]

#puts "$areaCode $prefix $company $rateCenter $state"
if {[regexp {[0-9]{3}} $areaCode]} {
puts "
\[HKEY_LOCAL_MACHINE\\SOFTWARE\\HTC\\PHONE\\AreaCode \\\\$areaCode\\$prefix\\]
\"Company\"=\"$company\"
\"RateCenter\"=\"$rateCenter\"
\"State\"=\"$state\"
"
}

}

close $f
Reply With Quote