Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Dos script to search into .txt file
Name: vishuonly4u Date: July 17, 2008 at 08:39:10 Pacific OS: 2k CPU/Ram: 1.8
Comment:
Team,
Every day we get some bunch of .txt files.
I want to search into a log files(*.txt) for a string DONE, with help of Dos script.
Could you please help me in this. How to search for DONE keyword in the file.
Name: Mechanix2Go Date: July 17, 2008 at 23:25:43 Pacific
Reply:
There is no findstr in DOS.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: vishuonly4u Date: July 28, 2008 at 12:50:09 Pacific
Reply:
Team , I want to ask u some more in this. " for %%f in ("*.txt") do ( echo "%%f" | find %%f /c "<reply>done</reply>" if !errorlevel! EQU 0 set /a count=count+1 )" Using this code I am able t count the file where I have this lines. But now I want to count the files where I dont have this code. Like := <reply>done</reply> is the Positive reply state. But when we have error (-ve state) during that time we get <reply>NOT DONE</reply> or <reply>The error information</reply>
So understand when we have error I am planing to search inside the file for error message... but its not a common .. so I cant put that into the search string pattern.
So I am planing to scan the files which DONT HAVE this lines. <reply>done</reply>.
I dont know how to do this?? Could you please help me on this
Summary: I got good to know about how to search into the file(Topic : Dos script to search into .txt file) but now I want to ask u one more question about file search. Team , I want to ask u some more in this....
Summary: Is there any way to use the dir command / some DOS Script to select only first file of similar pattern of files in a direcotory and rename it for example, one directory has 5 files abc_1005.txt abc_5...
Summary: Can you plz. assist me if you have a simple script to search for a text in a view source of a HTML page? For example a page for DELL I want to list a model # and price information of that page in a si...