Hi All,
I am searching for two string in the .log file
The strings are
Active Flop-Maps "0 0 1 0 1" 1
and
Ouput-Maps " 0 0 1 1 0" 2
It should search in the file ignoring white spaces .Tell me what is wrong with this script.
The tcl script is as follows
proc proc2 {arglist} {
set header {}
set i 0;
foreach a $arglist {
if {[string compare {" "} $a]} {
append header "\[\]\*" $a
}
}
set trimmed [string trimleft $header '\[\]\']
set trimmed1 [string trimleft $trimmed *]
return $trimmed1
set matches [exec grep{trimmed1} abc.log]
puts $matches
}
proc2 "Active Flop-Maps 0 0 1 0 1 0" 1
proc2 "Ouput-Maps 0 0 1 1 0" 2
Thanks in advance.
--Saraswati
---------- Post updated at 01:40 PM ---------- Previous update was at 01:38 PM ----------
If i will change the Active Flop-Maps 0 0 1 0 1 0" 1 to Active Flop-Maps 0 1 1 1 1 0" 1 it shouldn't match
Moderator's Comments:
|
|
Please use next time code tags for your code and data
|
|