Go Back   Tech Support Forum > Alternative Computing > Other Operating systems

User Tag List

MS-DOS Batch programming

This is a discussion on MS-DOS Batch programming within the Other Operating systems forums, part of the Tech Support Forum category. I have done a lot of scanning of historical documents, including lots of letters from the 1930s. Each letter is


Closed Thread
 
Thread Tools Search this Thread
Old 01-27-2018, 06:20 AM   #1
Registered Member
 
Join Date: Nov 2009
Posts: 29
OS: XP



I have done a lot of scanning of historical documents, including lots of letters from the 1930s. Each letter is then transcribed into a .txt file in that folder.

The scans are in separate folders for each letter, and these are subfolders of folders for each author, and these again are subfolders of separate folders for each recipient.

Recipient 1
......Author 1
............Letter 1
..................Letter 1 Scan 1
..................Letter 1 Scan 2
..................Letter 1 Scan 3
..................Letter 1 Scan 4
..................Letter 1 Scan 5
..................Letter 1.txt
............Letter 2
............Letter 3
......Author 2
......Author 3
Recipient 2
Recipient 3

etc., etc., etc. At least a couple of thousand letters, up to 20 pages long, so a very large number of files, but only one .txt file for each letter.

I want a batch file that will search ALL those .txt files to abstract all references to a given word, I guess "given phrase" would be nice, but probably TFD.

Here's what I have so far, but it will only do the one specific folder. How can I make it do ALL levels of sub-folders ?

This is called from a DOS window, with "Search myword", so %1 = myword

Code:
REM Search.bat
S:
cd "S:\Family\Clay"
find /I %1 *.txt >>S:/Results.txt 
start S:/results.txt
I think I may have to have a previous .bat that calls this one with each folder name. But that's beyond me, Alas !

That's for letters. I also have my mother's 75 diaries, now all scanned, & being transcribed; and I would like something similar to search all her diaries for a specific word. But they are WORD documents - so I guess a whole new ball-game !

Help ! Please ?
Robin Clay is offline  
Sponsored Links
Advertisement
 
Old 01-29-2018, 02:10 AM   #2
Moderator
Windows Tech Team
Hardware Tech Team
 
Join Date: Aug 2008
Location: INDIA
Posts: 2,976
OS: Windows 10 | CentOS | Manjaro



Not too good with batch, but a logical approach would be to use a For loop to cycle through the directories before the Find line, also use the braces correctly when using the for loop and various parameters.
__________________


tristar is offline  
Old 01-30-2018, 02:46 AM   #3
Registered Member
 
Join Date: Nov 2009
Posts: 29
OS: XP



Thank you, TriStar, for your response.

Alas ! That is where I need help, in acquiring the subfolder names, and in recursion.
Robin Clay is offline  
Sponsored Links
Advertisement
 
Old 01-30-2018, 03:58 AM   #4
Moderator
Windows Tech Team
Hardware Tech Team
 
Join Date: Aug 2008
Location: INDIA
Posts: 2,976
OS: Windows 10 | CentOS | Manjaro



This is the syntax:

Code:
FOR /D [/r] %%parameter IN (folder_set) DO command
/r - recurse, /D is for cycling through directories, folder_set would be your root folder under which your sub dirs reside and what you would like it to do command
__________________


tristar is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Issues
I am having trouble connecting to a wireless network on my Asus K601 laptop. I can connect via Ethernet cable with no problem. My ISP is CenturyLink (Qwest), router is make ZYXEL and model is PK5001Z. I have AVG Antivirus free addition. All the appropriate lights on the router are on but in the...
katkan Networking Support 37 07-01-2013 07:58 PM
yahoo mail failed ping test email not working?
yeah..i just found out that my yahoo email failed the ping test given by microsoft network diagnostics...also..i cant open any links in my email messages..something about a rundll 32 file?
bigdan13 Windows XP Support 12 06-04-2013 12:09 AM
Dell 630 wireless problems
I was useing my 630 laptop when it suddendly stopped seeing the wireless conection. I have another laptop(Toshiba) that works perfect with the same wireless. I am useing windows 7 and have tried reset in the explorer tools andhave flushed the dns server. please help thanks
taxidermyone Windows 7 , Windows Vista Support 12 10-19-2012 04:25 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 02:46 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts