Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a log file generated after building and compiling. What I need to do now is to extract all the error out (kinda creating an error log) and send them out via Blat (of which I'm not very familiar too)
Aim: Extract all lines containing keyword "Error" and sent them out using Blat (command line e-mail client)
I thought of extracting those lines and append them to a file and send the contents of this new file and send it out but I have no idea how to search thru the text file with a keyword and extract the whole line. I fig prolly using a loop variable to keep count of the line number while using if-control that match the string. But I'm not very familiar with batch scripting yet so I'm posting this here for any help that is available while I'm working on this.
All help is appreciated thanks.
SchizophrenicX
"I'm not psychic; I'm just damn good"

This is what I have for the extraction part.
log file name: m80dbg.log
output file name: errlog.log, errlist.logfindstr /r /c:"[^0] error(s)" m80dbg.log >errlist.log
findstr /r /c:"error" m80dbg.log >errlog.logthe problem is that the list of errors didn't came out as expected (errlist.log)
in cmd it has something like thisblahblah - a error(s), b warning(s)
blahblah - c error(s), d warning(s)which is nice, but in the errlist.log most parts didn't come out nicely in new lines. Instead it looked something like this...
blahblah - a error(s), b warning(s)blahblah - c error(s), d warning(s)blahblah - e error(s), f warning(s)
blahblah - g error(s), h warning(s)blahblahand so on... how do I redirect into the file with each nicely formatted into new line?
I'm looking into sending the mail now. Actually I wouldn't need the errlist.log as I will be sending the output of findstr /r /c:"[^0] error(s)" as the body message of the e-mail. I'm not sure. All help is appreciated thank you.
SchizophrenicX
"I'm not psychic; I'm just damn good"

no one yet? I've just confirmed that I'll need the errlist.log and so I need some help formatting it. Also I need to append another similar output into this file. Please help with the output. Thank you
Installing BLAT now.
SchizophrenicX
"I'm not psychic; I'm just damn good"

find /i "error" < my.log > error.log
=====================================
If at first you don't succeed, you're about average.M2

Wow thanks a bunch Mechanix2Go, you really me out here. Anyway, with that out of the way, you think you could explain to me how come my part output in such a format and find/i gave the format i was looking for?
SchizophrenicX
"I'm not psychic; I'm just damn good"

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |