Batch Script to compare data
Batch Script to compare data Every day in my team a group of people extract a report from a portal and name it like ABC_23MAY2018.txt , XYZ_23MAY2018.txt and save it in a directory. ABC_23MAY2018.txt XYZ_23MAY2018.txt But because it is a manual process people do mistake like they extract the report of 22MAY2018 (giving the wrong date on the portal input) and name it ABC_23MAY2018.txt etc. This has caused of lots of issues as the file is used for reports purposes. I was thinking to create a batch script which will extract the date from the file name - 23MAY2018 and compare it with the date which will be extracted in another file date.txt. I have figured out to extract the date from file name : 22MAY2018 ABC_23MAY2018.txt 23MAY2018 set Filedate=ABC*.csv for /f %%A in ('dir /b %Filedate%') do ( set filename=%%~A set fileCSV=!filename:~9,10! echo !filename:~9,10! ) But how to compare it with the date in the file. for example, after extracting the date from filename its ...