Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in
1) starting with "20071126 11:11:11 Machine Header 1"
1000 lines...
"End machine header 1"
2) starting with "20071126 12:12:12 Machine Header 2"
1000 lines...
"End machine header 2"
2) starting with "20071126 12:12:12 Machine Header 3"
1000 lines...
"End machine header 3"
With this their are a lot of junk data also..
I just want to grab these 3 headers and put in into different file With each header having his own sections
eg:
===================Header1 Start====================
<it's content>
===================Header1 End ====================
how I can do this .. I want something like this
./<New script> <old log file>
and it gives me a new log file.
Can you please help me in making this... I want to make it in bash scripting.
Well Its not an Class Room as well as homework problem.. I am trying to make some real world test result documentation script.As i am new to shell domain.. I am not able to figure out this that easily, Till now I have done this much
#!/bin/sh
#set -x
file=$1
echo $file
while read line;
do
echo $line
done < $file
With this I am able to read my file properly but the data is not coming with proper indentation, It is loosing its initial spacing which I dont want.