A big thanks to RM singh for sharing data https://drive.google.com/drive/folders/0B8e3dtbFwQWUZ1I5dklCMmE5M2M
The following code will copy files present in f:\stocks\datacode\modfl_2.txt from src folder to dest folder. It will maintain the folder structure present in source folder.
The format for modfl_2.txt is as follows
ASHOKLEY.txt
ASIANPAINT.txt
rem @echo off
set src_folder=f:\Stocks\midata\2019
set dst_folder=f:\Stocks\mydata2019
for /f "tokens=*" %%G in ('dir /ad /b /s "%src_folder%"') do (
for /f "tokens=*" %%i in (d:\stocks\datacode\modfl_2.txt) do (
echo d | xcopy /S/E "%%G\%%i" "%dst_folder%\%%~nG"
rem echo "%%G\%%i"
rem echo "%dst_folder%\%%~nG"
)
)
The following code will copy files present in f:\stocks\datacode\modfl_2.txt from src folder to dest folder. It will maintain the folder structure present in source folder.
The format for modfl_2.txt is as follows
ASHOKLEY.txt
ASIANPAINT.txt
rem @echo off
set src_folder=f:\Stocks\midata\2019
set dst_folder=f:\Stocks\mydata2019
for /f "tokens=*" %%G in ('dir /ad /b /s "%src_folder%"') do (
for /f "tokens=*" %%i in (d:\stocks\datacode\modfl_2.txt) do (
echo d | xcopy /S/E "%%G\%%i" "%dst_folder%\%%~nG"
rem echo "%%G\%%i"
rem echo "%dst_folder%\%%~nG"
)
)