I have several logfiles stored in a dir lets say /x_dir.
Log files are divided in different sections A B C
A is Textual part
B is mostly tabulated
C is also tabulated but with more columns
A-----
ds ads adsa
ad sad sads
ad sa dsa dsa
dsa dsad sad
ad sad sa dsa
asd sa dsasa
B------
name 2
age 3
len 4
char 5
e 6
C------
header min max avg
a 2 3 4
b 6 7 8
c 10 11 12
d 1 2 3
e 5 6 7
Currently I am using a for loop i.e
for file in $(ls /x_dir)
do
grep "pattern" | awk '{print $"what I need"}' >> write_to_a_file
..
..
..
.
.
.
repeat until values from all the rows are extracted
done
After this I have to display these extracted values column wise with column headings being the same for the row of each name in section B and C . like :
logfile_no name age len char a b c d e
1 x x x x min-max min-max min-max min-max min-max
2 x x x x min-max min-max min-max min-max min-max
3 x x x x min-max min-max min-max min-max min-max
4 x x x x min-max min-max min-max min-max min-max
I am doing this by pasting several files together into one file and the doing a
cat filename to display the contents on screen.
please see the script if you want to see details :
I am new to Tcl and couldn't get my head around on a quick and better way to do it in Tcl.
I want to switch to tcl in order to get it running with a GUI which I have started writing with Tk.
Thanks for Help.