Hi cats, please I have a file called c:\listoffiles.txt that contatins this text:
-rw-rw-rw- 1 admin admin 15023676 Oct 3 11:24 C0001.MXF
-rw-rw-rw- 1 admin admin 15019580 Oct 3 11:24 C0002.MXF
-rw-rw-rw- 1 admin admin 84170824 Oct 3 19:09 C0020.MXF
-rw-rw-rw- 1 admin admin 101425748 Oct 3 23:07 C0021.MXF
-rw-rw-rw- 1 admin admin 102679124 Oct 3 23:08 C0022.MXF
-rw-rw-rw- 1 admin admin 15605308 Oct 7 14:10 C0023.MXF
I would like do a batch that do this:
generate a file .txt c:\ListOfFilenamesOnly.txt that contains:
C0001.MXF
C0002.MXF
C0020.MXF
C0021.MXF
C0022.MXF
C0023.MXF
and generate a enviroment variable %ListOfFilenamesOnly% that contains the same of the .txt file
I have try something like:
but seems don't workCode:for /f "tokens=8*" %%A in ('c:\listoffiles.txt') do echo %%B > c:\ListOfFilenamesOnly.txt
How can I resolve? thanjks
+ Reply to Thread
Results 1 to 2 of 2
-
Last edited by marcorocchini; 7th Oct 2014 at 07:42.
-
sorry, in the meantime I have solved for a script that goto in ftp-camera, check files and generate a list of .mxf
Code:@echo off set "name=admin" set "password=pdw-f800" set "server=192.168.0.18" ping %server% |find /i "TTL=" >nul || (echo camera offline, aborting&pause&goto :EOF) set "ftpScript=c:\pingatemp.ftp.tmp" ( echo open %server% echo %name% echo %password% echo cd clip echo dir echo quit ) > "%ftpScript%" for /f "tokens=8*" %%A in ('ftp -s:%ftpScript% ^| findstr /i /e ".mxf"') do @echo %%B del "%ftpScript%" goto :eof