Reputation: 119
I need to prepare a batch file using a batch script to 1) Loop through files (.csv) files in a given directory and just take out the name of CSV file 2) Use this csv file name and concatenate with some string like below
"String1" "File Name1"
"String2"
"String1" "File Name2"
"String2"
"String1" "File Name3"
"String2"
3) redirect this output to another batch file.
Am new to creating batch scripts. Can any one here help me with an idea to create the script?
Upvotes: 0
Views: 900
Reputation: 9545
Something like this :
EDIT :
@echo off
set $string="TOTO"
set $string2="TATA"
set "$Path=c:\test\"
pushd %$Path%
(for %%a in (*.csv) do (
echo %%~dpnxa %$string%
echo %$string2%))>Output.txt
popd
Upvotes: 1