set f "log"
set f1 "list"
set f2 "listall"
set f [open $f]
set f1 [open $f1 w]
set f2 [open $f2 w]
set l1 {}
set l2 {}
while {[gets $f line] >= 0} {
if {[regexp {\.[a-z_A-Z]*$} $line match]} {
set y [split $line /]
set a [lindex $y 1]
set b [lindex $y end]
set b [split $b .]
set b [lindex $b end]
set final [format "%50s .%-20s" $a $b]
set single "$a $b"
lappend l1 $final
lappend l2 $a
}
}
set newl1 [lsort -unique $l1]
set newl2 [lsort -unique $l2]
puts $newl2
foreach n $newl2 {
set pa $n
set kong {}
foreach m $newl1 {
set p [lindex $m 0]
set v [lindex $m 1]
if { $p == $pa } {
lappend kong $v
}
}
set ff "$pa includes this format: ( $kong ) "
puts $f1 $ff
}
foreach n $l1 {
puts $f2 $n
}
close $f1
close $f2
close $f