Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create several documents at once command line

Featured Replies

Hi guys!

Instead of creating a batch file...

How do I create several files with differnt names at once....seen many how to's for directories but not actual documents?

 

bookie32

 

1 hour ago, bookie32 said:

Hi guys!

Instead of creating a batch file...

How do I create several files with differnt names at once....seen many how to's for directories but not actual documents?

 

bookie32

What do you mean? :w00t:

"Random" files? :dubbio:

https://www.digitalcitizen.life/3-ways-create-random-dummy-files-windows-given-size

or

http://www.bertel.de/software/rdfc/index-en.html

jaclaz

  • Author

Hi jaclaz:D

Yes...that can work.....

I was thinking on the lines of:

dir > text.txt text1.txt text2.txt

I just wondered how I could create several documents at once with just one line of code...

 

bookie32

I will try again:

WHAT do you want to do?

You don't pay a fee per word posted, DESCRIBE in DETAIL what you need/want, otherwise you will only have people attempting to help you lose their time in guesses.

A one liner that creates an arbitrary number of  files (10 in this example, each containing the text "File" followed by the same progressive number that is also added to the filename) :

FOR /L %? IN (1,1,10) DO ECHO File%?>text%?.txt

jaclaz

 

  • Author

OK not following:

I cannot write the code as shown:

dir > text.txt text1.txt text2.txt

instead of writing:

dir > text.txt 

and then:

dir > text1.txt 

And so on...how do I write one line of code that creates all three files?

 

bookie32

58 minutes ago, bookie32 said:

OK not following:

I cannot write the code as shown:

 

No. (You can actually "write the code as shown" but the result upon execution won't be three files).

1 hour ago, bookie32 said:

And so on...how do I write one line of code that creates all three files?

 

You can use a FOR /L loop, as shown.

Or, if you literally want three files called text.txt, text1.txt and text2.txt, all of them with the same content, the output of the command DIR:

dir>text.txt&dir>text1.txt&dir>text2.txt

almost the same result:

FOR /L %? IN (0,1,2) DO DIR>text%?.txt

actually the same result:

DIR>text.txt&FOR /L %? IN (1,1,2) DO COPY text.txt text%?.txt

jaclaz

Or maybe like this :

dir > text.txt & copy /y text.txt text1.txt & copy /y text.txt text2.txt

:P

  • Author

Hi guys😀

Thanks for the help...😁

bookie32

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.