hello,
I want to grep the log file according to time and get the portion of log from one particular time to other.
I can grep for individual lines by time but how should I print lines continuously from given start time till end till given end time.
Hello vino,
when I am using
sed -e "/start pattern/,/end pattern/p" file > tmpfile
tmpfile is containing duplicate lines from start pattern to end pattern along with the whole 'file'. I am not able to output only those lines ???
I was getting what I wanted when I do diff between two files but now I need it in a file.
Need assistance...Thanks
If I have to put these lines from start pattern to end pattern into another file at the same place, I am not able to do so.
I tried to use sed -s again to try if it adds to the target file. but its adding at the end and also duplicating the lines.
sed -n 's/\"/echo config_start/,/echo \"end_install\"/p"//' config1.log>tmpfile
sed -n 's/\"/echo config_start/,/echo \"end_install\"/p"//' tmpfile config2.log
when I do this, it's adding each line in tmpfile twice and also at the end of config2.log
When looked into sed, i saw sed -f functionality but not able to get the syntax.
I tried several combinations with awk, but the only piece missing is that the lines sitting at the right place in the file.
As sed -n picked the lines from a start pattern, I want to insert them exactly like that.
Any suggestions ...
We really appreciate help on this...
Basically I have file which has:
...
...
echo config_start
text1
text2
...
few lines of text
echo end_install
...
Another file has
....
...
echo config_start
echo end_install
....
I need to copy from file1 to file2.
With the sed command below, I was able to get the text from file1. But couldn't put it in file2.
Please need help on this..guys...appreciate your ideas..
I browsed in this forum and I got this lead...can/how do I use it ??
friends,
we need help on this very much as its not ringing bell to us and request some kind of solution/lead/advise.
very much anticipating help....
thanks
chiru
chandra004 and chiru_h, please do not bump up posts. That goes against forum rules.
Please keep in mind that the forum members do have their own jobs and lives as well... you will get answers, just have some patience.