|Here is my very modest Findstr batch file, which I use to locate certain info from remote machines. I've ran into an issue though, as the logs I examine have 2 seperate data sources which make up the log. I want to find a way to dispaly both parts of the feed through entering only a few pieces of information. |
echo "enter machine"
set /p machine=
echo"which log do you want to query?"
echo"what order do you want to look for"
findstr /i %order_number% %log_name% > c:\desktop\output1.txt
** this works and returns a text file with appropriate info **
My issue is that within the one log I have 2 seperate feeds which enter it. One feed gives me an accurate time stamp in local time (Australian Time), the other feed has a time stamp which is in UTC, and is not accurate, however this feed contains all the important info. Example of how they look.
[22:30:10:555 25/09/09: Session began host process starting- recieved msg]
The two are always bunched together, but sit in the log on seperate lines. Is there any way I can use findstr (or any other DOS command) to capture the line of text which preceeds my result.
*uSING THE EXAMPLE ABOVE*
Findstr /i 35=D LOG01
would return the whole line (8=FIX4.0;35=D;44=66666;122=12:30 ......
Is there anyway I can also retreive the line before, in PROC begining with [22:30:10:555 25/09/09: Session began .... using a dos command.
I cant use any form a calculation to convert the times in LOG01 to PROC as the LOG01 time stamp is not accurate.
Please anyone tell me if I'm making this clear or if I'm being dumb. Help would be very much appreciated.
Thanks for reading