Eu criei um script que você pode achar útil.
Crie uma pasta chamada accounts e salve o script com a extensão .vbs.
Crie uma pasta na pasta de contas chamada entrada . copiar todos os arquivos de contas a serem pesquisados para a pasta de entrada, todos eles devem ser arquivos .txt ou eles serão ignorados.
Crie um arquivo chamado account_numbers.txt e liste cada número de conta em uma linha separada. O script deve abrir cada arquivo, ler uma linha e verificar cada número de conta. Os resultados da pesquisa são armazenados em accounts_found.txt . Fornecido sem garantia, use a seu próprio risco. Espero que ajude.
' find all occurrances of an account number in a number of files
' place all account txt files into input folder
' accounts_found.txt is created if it is missing
' by 'Robert' 2017 - hereby placed into the Public Domain
' set some Constants here
Const ForRead = 1
Const ForWrite = 2
Const ForAppend = 8
Const OverWrite = True
Const NoOverWrite = False
Dim acct_num_list(100) ' max records for the array, num_accounts variable counts them anyway
inputFolderName = "input\" ' the folder where the txt files are
outputFileName = "accounts_found.txt" ' the output file for matched records
accountsFileName = "account_numbers.txt" ' the file which contains account numbers to search for
' = = = Start of Code = = =
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set outFile = objFSO.OpenTextFile(outputFileName, ForWrite, OverWrite)
Set objInputFolder = objFSO.GetFolder(inputFolderName)
Set sFileCollection = objInputFolder.Files
Set accounts_file = objFSO.OpenTextFile(accountsFileName, ForRead)
num_accounts = 0
DO While Not accounts_file.AtEndOfStream
acct_num_list(num_accounts) = accounts_file.ReadLine
num_accounts = num_accounts + 1
Loop
accounts_file.Close
For Each objFile in sFileCollection
If UCASE(objFSO.GetExtensionName(objFile)) = "TXT" then
Set sourceFile = objFSO.OpenTextFile(inputFolderName & objFile.Name, ForRead)
Do While Not sourceFile.AtEndOfStream
curr_line = sourceFile.ReadLine
For counter = 0 to num_accounts
if instr(1, curr_line, acct_num_list(counter),1) >= 1 then
outFile.WriteLine curr_line
End If
Next
Loop
End If
Next
' = = = End Of File = = =