How to group texts from files (.txt) into a new one with command prompt

How to group texts from files (.txt) into a new one with command prompt
How to group texts from files (.txt) into a new one with command prompt
Anonim

It is sometimes useful to merge many text files into one, for example notes taken on the same topic. Under Windows, all you have to do is go through the command prompt on a current folder, which contains all the files to be merged. A very simple command in this prompt and voila!

Steps

Merge Text (.Txt) Files in Command Prompt Step 1

Step 1. Right click the Start menu button (

Windowsstart

).

This button (Windows logo) is in the lower left corner of the screen. From the context menu, select File Explorer. For the merger to take place, all the files to be merged will be in the same folder. If they were scattered, you would move them or copy them to one folder.

To be sure to spot them in the merged file, at the end of each of the starting files, leave a blank line or type separators.

Merge Text (.Txt) Files in Command Prompt Step 2

Step 2. Open the folder that contains the seed files

In Explorer (right column), click This PC Where Computer. If it is not already the case, make appear, then click on the folder containing your initial files. They should all appear in the right window.

Merge Text (.Txt) Files in Command Prompt Step 3

Step 3. Bring up the contextual menu of the right window

On the empty space of this window, hold down the Shift key, then right-click.

Merge Text (.Txt) Files in Command Prompt Step 4

Step 4. Click Open Command Window Here

This opens a command prompt in the current folder, where all your files are.

  • If the PowerShell interface on Windows was enabled, you should click Open PowerShell window here.
Merge Text (.Txt) Files in Command Prompt Step 5

Step 5. At the prompt, type copy *.txt newfile.txt

Replace newfile.txt with whatever name you want to give your merged file, for example mergefile.txt.

Merge Text (.Txt) Files in Command Prompt Step 6

Step 6. Validate with the Enter key

The files of the whole folder are then merged into one and this new file is found in the folder concerned.

Popular by topic