Batch to search, list, compare, delete, and verify/confirm

June 9, 2013 at 17:53:52
Specs: Windows 7
Greetings all.

I currently have a spreadsheet with a list of "Nonactive" accounts (10 digits) in col A. Accounts are manually added/deleted from this list manually from time to time.
I have files that come into 4 networked servers (P8A, P8B, P8C, and P8D) in c:\combatch\subfolder\835. Right now, I use the DOS ts (text search) command to look for a string in all files, and delete the file if the string matches the one in the list, col A.

Is it possible to create a batch/macro to:
a. search all files in the 835 folders
b. list server and subfolder name in col B, filename in col C, timestamp in col D
c. compare the text search "GS*??*" & ?????????? with col A
if match found, then delete
d. cycle through filenames found in col C again, and put "Deleted" in col E if not found (obviously, since it was just deleted in step c)

So, basically, it's a macro to search, list, compare, delete, and verify/confirm. If it's not possible, then I'll see if I can make some DOS batch programs to do it. Thanks!

See More: Batch to search, list, compare, delete, and verify/confirm

Report •

June 10, 2013 at 13:08:19
It's mostly step C that confuses me. I think the ten ? would overlap the gs*??* specification. Maybe if you showed a few examples of the contents of column A and note whether they qualify or don't qualify, we could come up with a good RE.
In step A, I assume you mean "list", and not "search"? ie: to list the path, filename, and timestamp of all existing files in all subdirs off 835? THEN do the regexp on column A, and if qualifies, delete the file listed in col. C and put "deleted" in E.
I'm sucky at excel vba, so I might not be up to this although I'm about sure it could be done by someone with more experience.

Report •
Related Solutions

Ask Question