The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,152 other subscribers

For – Loop through a range of numbers | Windows CMD | SS64.com

Posted by jpluimers on 2017/06/27

Since I always forget:

for /l %1 in (1,2,200) do echo %1 >> text-%1.txt

This creates files with incremental filenames like this:

text-1.txt
text-3.txt
...
text-199.txt

–jeroen

via: For – Loop through a range of numbers | Windows CMD | SS64.com [WayBack]

4 Responses to “For – Loop through a range of numbers | Windows CMD | SS64.com”

  1. ruurd said

    Now do the same for 000 001 002 003 004 005 … 998 999

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: