Hi cats,
please I wonder if is there a way to build a batch that output the last modified .mxf file in a folder
for example:
C0001.MXF
C0002.MXF
...
C0008.MXF is the last
--> the batch should out C0008.MXF
thanks
+ Reply to Thread
Results 1 to 5 of 5
-
-
https://www.experts-exchange.com/questions/20926359/Finding-the-last-modified-file-thr...S-command.html
:: ----------EXAMPLE.BAT-----------
@ECHO OFF
FOR /F "DELIMS=" %%F IN ('DIR /B /A-D /OD /TW C:\FOLDER\c*.mxf') DO (
SET FILE=%%F
)
ECHO Most recently modified file is:
ECHO %FILE%
ECHO %FILE% > X:\OutputPath\Results.txt
:: ----------EXAMPLE.BAT-----------
Modify paths,folders for your needs -
thanks you, I see that only now. However honestly I need to change my basic request in this way:
https://forum.videohelp.com/threads/384994-batch-to-return-the-last-item-in-a-txt-file -
Hi, please I have a myfile.txt that contains:
Code:
"C0001.MXF" "C0002.MXF" "C0003.MXF" "C0004.MXF" "C0005.MXF" "C0006.MXF" "C0007.MXF"
Can I isolate only the last item:
C0007.MXF
? thanks
You may have to adjust myfile.txt but you can use multiple delimiters:
https://stackoverflow.com/questions/32690206/delims-more-then-1-character-as-delimiter
Code:@echo off setlocal enableextensions disabledelayedexpansion for /f "delims=" %%a in (myfile.txt) do ( set "buffer=%%a" setlocal enabledelayedexpansion (for /f "tokens=1,2,3,4,5,6,7 delims=¬" %%b in ("!buffer:" "=¬!") do ( endlocal echo full line : [%%a] echo first token : [%%b] echo second token : [%%c] echo third token : [%%d] echo fourth token : [%%e] echo fifth token : [%%f] echo 6th token : [%%g] echo Last token : [%%h] )) || if "!!"=="" endlocal )
Similar Threads
-
How to batch split mkv in different folder to another location?
By yusoffb01 in forum Newbie / General discussionsReplies: 2Last Post: 2nd Jun 2017, 07:30 -
FFMPEG - Looking for simple batch script to convert entire folder
By steptoe in forum Video ConversionReplies: 6Last Post: 20th Mar 2017, 22:49 -
batch demux video folder
By montevo in forum Newbie / General discussionsReplies: 0Last Post: 16th Jun 2016, 06:56 -
Handbrake conversion in recursive batch, preserving date modified
By bluesjumper in forum Video ConversionReplies: 10Last Post: 5th Jun 2015, 02:21 -
Set the current folder as destination folder and workfolder in a BATCH
By marcorocchini in forum Newbie / General discussionsReplies: 7Last Post: 25th Jun 2014, 07:58