• Login
Community
  • Login

How to create multiple files from a single text file ?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 3.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    Robin Cruise
    last edited by Robin Cruise Feb 10, 2021, 12:50 PM Feb 10, 2021, 12:49 PM

    hi. Maybe you could help me. I want create multiple files from a single text file, with the same content. For example, I have a file called laptop.txt I want to multiply this file, in another 120 files with other name, but with the same content.

    laptop.txt

    must become:

    inform.txt
    cd-translate.txt
    keyboard.txt
    books.txt
    ...
    120-line.txt

    A 1 Reply Last reply Feb 10, 2021, 1:03 PM Reply Quote 0
    • A
      Alan Kilborn @Robin Cruise
      last edited by Alan Kilborn Feb 10, 2021, 1:03 PM Feb 10, 2021, 1:03 PM

      @Robin-Cruise

      So I won’t go too deep into it but your best bet is to use Notepad++ to create a batch file, and then run that batch file outside of N++.

      Start with your “must become” list in a fresh N++ tab:

      inform.txt
      cd-translate.txt
      keyboard.txt
      books.txt
      

      Create a “column caret” in column 1 by using Shift+Alt+arrows (shown in following as thick black/red vertical line – note: yours will look a bit different):

      ef4d8a2a-24d0-4398-bcd8-9771aa9a7314-image.png

      Use the Column Editor (Alt+C) to insert text into every column 1 location, note the trailing space:

      b96e9fd9-e603-49a1-a28a-57d0232cc6f2-image.png

      To end up with this in your tab:

      copy laptop.txt inform.txt
      copy laptop.txt cd-translate.txt
      copy laptop.txt keyboard.txt
      copy laptop.txt books.txt
      

      Save your tab with extension .bat or .cmd in the same folder as laptop.txt. Example name for it would be runme.bat

      Get a command-prompt in that folder (by right-clicking your N++ tab and choosing Open Containing Folder in cmd).

      Type runme in the cmd window and press Enter.

      (It appears I went deep into it)

      1 Reply Last reply Reply Quote 4
      • R
        Robin Cruise
        last edited by Robin Cruise Feb 10, 2021, 1:16 PM Feb 10, 2021, 1:13 PM

        This post is deleted!
        A 1 Reply Last reply Feb 10, 2021, 1:19 PM Reply Quote 0
        • A
          Alan Kilborn @Robin Cruise
          last edited by Feb 10, 2021, 1:19 PM

          @Robin-Cruise said in How to create multiple files from a single text file ?:

          I believe it’s not working

          Hmm. What do you think the problem might be?

          1 Reply Last reply Reply Quote 0
          • R
            Robin Cruise
            last edited by Feb 10, 2021, 1:25 PM

            WORKS PERFECTLY, thanks !!

            1 Reply Last reply Reply Quote 1
            1 out of 5
            • First post
              1/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors