Currently I'm using the below script to take my file "Test2.txt" and separate it into 2 files based on the "tabs.txt" file.
I am hiding a roadblock trying to get some variables to work;
1 - have the script run against ANY file in a folder, ie "M:\pha\test\*.txt"
2 - move the original file to a folder "M:\pha\test\archive"
3 - add the date and time to the name of the 2 New files
4 - move the 2 new files to separate folders
Any help would be greatly appreciated. It's been a while since I've created batch files and feel out of my depth at times. Thank you for sharing your expertise.
Code: Select all
@echo off&setlocal
set "ffile=TEST2.txt"
set "fsearch=Narc_tabs.txt"
set "ftemp=%temp%\%random%.tmp"
(for /f usebackq %%i in ("%fsearch%") do echo( %%i )>"%ftemp%"
findstr /lg:"%ftemp%" "%ffile%">"%file%Narc.txt"
findstr /lvg:"%ftemp%" "%ffile%">"%file%Pacmed.txt"
del "%ftemp%"
type "%file%.new?"