n00b
n00b

Reputation: 181

How to create multiple notepad files with different name using batch?

I am fairly new to any programming. I have a task to perform in which the requirement is detailed below:-

  1. To create multiple notepad files 65536 to be exact.
  2. Each file must have name starting from 1.txt upto 65536.txt.
  3. Each file will have a certain code in it, in which at a particular place the file name must appear for example the existing code looks like "DIAGRAM VARIABLE 0 0 1098 5 6" in this 1098 must be replaced by 1 and then so on as per the file name.

Hope this explanation states the issue.

Maters of programming, bring me out of this.

Thanks in advance.

Upvotes: 2

Views: 2013

Answers (1)

BobbyTables
BobbyTables

Reputation: 4685

You can try this (havent tested) for /l iterates %%x from 1 to 65536 and then echo writes whats left of the > to the filename specified to the right.

for /l %%x in (1, 1, 6 ) do (
 echo STRING TO BE WRITTEN NO %%x > %%x.txt
)

Upvotes: 1

Related Questions