File: cleanup_projlogs

package info (click to toggle)
taglog 0.2.5-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,480 kB
  • sloc: tcl: 8,199; makefile: 23; sh: 12
file content (29 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/tclsh

# Script to take a tag log file and convert every line which says
#  Project: something (other)
# to
#  Project: something
#

set filename $argv

set f [ open $filename r ]
set outfile "$filename.new"
set f2 [ open $outfile w ]

while { ![eof $f]} {
 set line [ gets $f]
 # does it start with Project:
 if { [string match Project:* $line ]} {
    set idx [ string first ( $line ]
 # do something with it
    if { $idx !=-1 } {
        incr idx -1
	set line [ string range $line 0 $idx]
        set line [string trimright $line]
	}
 }

puts $f2 $line
}