@echo off
setlocal enabledelayedexpansion

for /f "delims= " %%i in ('sqlcmd -S .\SQLEXPRESS -U sa -P password -Q "SET NOCOUNT ON; SELECT FORMAT(GETDATE()-1, 'MMdd');" -h-1') do (
    set MMDD=%%i & echo !MMDD!
)

for /f "delims=" %%i in ('REPAIR_LOG.txt') do (
    set st=%%i

endlocal

my repari_log.txt as
11108 : EJ111080318.ZIP R111080318.TXT T111080318.TXT 
11122 : EJ111220318.ZIP R111220318.TXT T111220318.TXT 
11128 : EJ111280318.ZIP R111280318.TXT T111280318.TXT 
11136 : EJ111360318.ZIP R111360318.TXT T111360318.TXT 
11138 : EJ111380318.ZIP 
11142 : EJ111420318.ZIP R111420318.TXT T111420318.TXT 
11144 : EJ111440318.ZIP R111440318.TXT T111440318.TXT 
11148 : EJ111480318.ZIP R111480318.TXT T111480318.TXT 
11190 : EJ111900318.ZIP R111900318.TXT T111900318.TXT 
11209 : EJ112090318.ZIP R112090318.TXT T112090318.TXT 
11231 : EJ112310318.ZIP R112310318.TXT T112310318.TXT 
17001 : EJ170010318.ZIP R170010318.TXT T170010318.TXT 
17008 : EJ170080318.ZIP R170080318.TXT T170080318.TXT 
15067 : EJ150670318.ZIP R150670318.TXT T150670318.TXT 
15068 : EJ150680318.ZIP R150680318.TXT T150680318.TXT 
21090 : EJ210900318.ZIP 
21260 : EJ212600318.ZIP R212600318.TXT T212600318.TXT 
21583 : EJ215830318.ZIP R215830318.TXT T215830318.TXT 
22283 : EJ222830318.ZIP R222830318.TXT T222830318.TXT 
22400 : EJ224000318.ZIP 
22640 : EJ226400318.ZIP R226400318.TXT T226400318.TXT 
22696 : R226960318.TXT T226960318.TXT 
31109 : EJ311090318.ZIP R311090318.TXT T311090318.TXT 
62013 : EJ620130318.ZIP R620130318.TXT T620130318.TXT 
62014 : EJ620140318.ZIP R620140318.TXT T620140318.TXT 
65008 : EJ650080318.ZIP 
65009 : EJ650090318.ZIP 
81002 : EJ810020318.ZIP 
82003 : EJ820030318.ZIP R820030318.TXT T820030318.TXT 
41003 : EJ410030318.ZIP R410030318.TXT T410030318.TXT 
41011 : EJ410110318.ZIP R410110318.TXT T410110318.TXT 
41016 : EJ410160318.ZIP R410160318.TXT T410160318.TXT 
41126 : EJ411260318.ZIP R411260318.TXT T411260318.TXT 
41156 : EJ411560318.ZIP R411560318.TXT T411560318.TXT 
41167 : EJ411670318.ZIP R411670318.TXT T411670318.TXT 
41181 : EJ411810318.ZIP 
41198 : EJ411980318.ZIP R411980318.TXT T411980318.TXT 
 
 
 
------------------------------------------------------------------------------------ 
 
PTH11108 
Link : Up 
FTP : OK 
EJ111080318.ZIP R111080318.TXT T111080318.TXT : File Not Found 
 
PTH11122 
Link : Up 
FTP : OK 
EJ111220318.ZIP R111220318.TXT T111220318.TXT : File Not Found 
 
PTH11128 
Link : Up 
FTP : OK 
EJ111280318.ZIP R111280318.TXT T111280318.TXT : File Not Found 
 
PTH11136 
Link : Up 
FTP : OK 
EJ111360318.ZIP R111360318.TXT T111360318.TXT : File Not Found 
 
PTH11138 
Link : Up 
FTP : OK 
Upload File : Success 
 
PTH11142 
Link : Up 
FTP : OK 
EJ111420318.ZIP R111420318.TXT T111420318.TXT : File Not Found 
 
PTH11144 
Link : Up 
FTP : OK 
EJ111440318.ZIP R111440318.TXT T111440318.TXT : File Not Found 
 
PTH11148 
Link : Up 
FTP : OK 
EJ111480318.ZIP R111480318.TXT T111480318.TXT : File Not Found 
 
PTH11190 
Link : Up 
FTP : OK 
EJ111900318.ZIP R111900318.TXT T111900318.TXT : File Not Found 
 
PTH11209 
Link : Up 
FTP : OK 
Upload File : Success 
 
PTH11231 
Link : Up 
FTP : OK 
EJ112310318.ZIP R112310318.TXT T112310318.TXT : File Not Found 
 
PTH17001 
Link : Up 
FTP : OK 
EJ170010318.ZIP R170010318.TXT T170010318.TXT : File Not Found 
 
PTH17008 
Link : Up 
FTP : OK 
EJ170080318.ZIP R170080318.TXT T170080318.TXT : File Not Found 
 
PTH15067 
Link : Up 
FTP : OK 
EJ150670318.ZIP R150670318.TXT T150670318.TXT : File Not Found 
 
PTH15068 
Link : Up 
FTP : OK 
EJ150680318.ZIP R150680318.TXT T150680318.TXT : File Not Found 
 
PTH21090 
Link : Up 
FTP : OK 
EJ210900318.ZIP : File Not Found 
 
PTH21260 
Link : Up 
FTP : OK 
EJ212600318.ZIP R212600318.TXT T212600318.TXT : File Not Found 
 
PTH21583 
Link : Up 
FTP : OK 
EJ215830318.ZIP R215830318.TXT T215830318.TXT : File Not Found 
 
PTH22283 
Link : Down 
 
PTH22400 
Link : Down 
 
PTH22640 
Link : Up 
FTP : OK 
EJ226400318.ZIP R226400318.TXT T226400318.TXT : File Not Found 
 
PTH22696 
Link : Up 
FTP : OK 
R226960318.TXT T226960318.TXT : File Not Found 
 
PTH31109 
Link : Up 
FTP : OK 
EJ311090318.ZIP R311090318.TXT T311090318.TXT : File Not Found 
 
PTH62013 
Link : Up 
FTP : OK 
EJ620130318.ZIP : File Not Found 
 
PTH62014 
Link : Up 
FTP : OK 
EJ620140318.ZIP R620140318.TXT T620140318.TXT : File Not Found 
 
PTH65008 
Link : Up 
FTP : OK 
EJ650080318.ZIP : File Not Found 
 
PTH65009 
Link : Up 
FTP : OK 
EJ650090318.ZIP : File Not Found 
 
PTH81002 
Link : Up 
FTP : OK 
EJ810020318.ZIP : File Not Found 
 
PTH82003 
Link : Up 
FTP : OK 
EJ820030318.ZIP R820030318.TXT T820030318.TXT : File Not Found 
 
PTH41003 
Link : Up 
FTP : OK 
EJ410030318.ZIP R410030318.TXT T410030318.TXT : File Not Found 
 
PTH41011 
Link : Up 
FTP : OK 
EJ410110318.ZIP R410110318.TXT T410110318.TXT : File Not Found 
 
PTH41016 
Link : Up 
FTP : OK 
EJ410160318.ZIP R410160318.TXT T410160318.TXT : File Not Found 
 
PTH41126 
Link : Up 
FTP : OK 
EJ411260318.ZIP R411260318.TXT T411260318.TXT : File Not Found 
 
PTH41156 
Link : Up 
FTP : OK 
EJ411560318.ZIP R411560318.TXT T411560318.TXT : File Not Found 
 
PTH41167 
Link : Up 
FTP : OK 
EJ411670318.ZIP R411670318.TXT T411670318.TXT : File Not Found 
 
PTH41181 
Link : Up 
FTP : OK 
EJ411810318.ZIP : File Not Found 
 
PTH41198 
Link : Up 
FTP : OK 
EJ411980318.ZIP R411980318.TXT T411980318.TXT : File Not Found 

i need store code from 5 digit of each line till found "" or ----- for end