Im a newbie pls suggest :- Is it possible to read txt files with the help of batch? there are 100 of txt files in a folder and in certain txt files a word for eg :-computing.net is written.... is ther any idea or batch to delete every txt files in the folder apart from the files which is containing the string computing.net...
A batch script can read and even parse text files in many ways, now according to what you want to achieve
@echo off & setlocal
cd Your_Folder
for %%j in (*.txt) do type "%%j" | find /I "computing.net" > nul || del "%%j"
Thank u dude its works ...how to do the same thing in a directory? is it possible?>
"How to do the same thing in a directory? Is it possible?"
What do you want to mean/achieve? The posted script does what you requested for all files stored in a directory and strings/words are stored in files not in directories.
The script checks for the word"computing.net" in the files which is kept in the current folder but is it possible to do check in the directory?
| « [Solved] How Do I Check If a Progr... | How Do I Delete Lines Fro... » |