Académique Documents
Professionnel Documents
Culture Documents
/usr/bin/tclsh -f
#===========================================================================
# File Name
: report_area_xls_conversion.tcl
# Date Created : 05/07/2013
# Version
: @Revision 1.0 @
# Summary
: Convert RC area report to xls format
# Keywords : convert conversion xls
#
# Description:
#
To convert the report area from RC in xls format
#
# Notes : For any query, pls write to mgupta@cadence.com
#===========================================================================
proc report_area_xls_conversion { args } {
switch -- [parse_option "[calling_proc]" {} $args \
"-report_file srs Report file name " input_file \
"-output_file srs Output Report file name " output_file] {
-1 { return }
0 {return -code error }
}
set rid [open $input_file r]
set wid [open $output_file.xls w+]
set count 0
set flag 0
while {![eof $rid]} {
set line [gets $rid]
if {[regexp {===} $line]} {
incr flag
puts $wid $line
}
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
}
if {[string match $line ""]} {
puts $wid $line
}
if {[expr $flag%2] == 0} {
if {([regexp {\s*Instance\s*Cells\s*Cell} $line])} {
set count [llength $line]
for {set i 0} {$i < $count} {incr i} {
set head_col($i) "[lindex $line $i]"
}
if {$count == 8} {
puts $wid "$head_col(0)\t$head_col(1)\t$head_col
(2) $head_col(3)\t$head_col(4) $head_col(5)\t$head_col(6) $head_col(7)"
} else {}
set line [gets $rid]
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
set line [gets $rid]
}
}