Solved Read txt files through batch

February 5, 2012 at 07:31:18
Specs: Windows XP
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...

See More: Read txt files through batch

Report •


#1
February 5, 2012 at 07:47:36
✔ Best Answer
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"


Report •

#2
February 6, 2012 at 04:01:55
Thank u dude its works ...how to do the same thing in a directory? is it possible?>

Report •

#3
February 6, 2012 at 06:42:11


"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.

Report •

Related Solutions

#4
February 7, 2012 at 06:46:49
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?

Report •


Ask Question