Hi Community,
I have 100s of word documents (.doc [2003 version]), i need to search each of them in loop for a particular word, and collect that line in a word document.
Thanks in advance for your help and support.
This is my ANSWER:
Code: Select all
#persistent
#SingleInstance Force
SetBatchLines, -1
FolderToSearchFor = c:\abc
OutPutFolder = c:\def
NeedleContent = YOURSTRING
needle = %NeedleContent%
FileRecycle, %OutPutFolder%\FileName.txt
Loop, %FolderToSearchFor%\*.doc, , 1
{
Loop, read, %A_LoopFileFullPath%
{
If A_LoopReadLine contains ><
continue
If A_LoopReadLine contains %needle%
{
FileAppend, %A_LoopReadLine%`n, %OutPutFolder%\FileName.txt
}
}
}