create .txt files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
joejames_786
Posts: 17
Joined: 12 Feb 2017 05:11

create .txt files

#1 Post by joejames_786 » 12 Apr 2018 08:03

hi

can someone help me ?


source folder is C:\update
destination folder is D:\despatch


source folder contains 1000,s of .xml files

I want a script to count the number of .xml files in that folder and
equally create .txt files in another folder (ie.. if .xml is 1025 then the number of .txt files
created is 1025)

thanx in advance

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: create .txt files

#2 Post by aGerman » 12 Apr 2018 08:15

It really sounds to me that you have some kind of XY Problems :?
untested:

Code: Select all

@for /f %%i in ('dir /a-d /b "C:\update\*.xml"^|find /c /v ""') do @for /l %%j in (1 1 %%i) do @type nul>"D:\despatch\%%j.txt"
Steffen

Post Reply