Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 11294

Enhancing Text File Merging on Windows Command Line [closed]

$
0
0

I hope you are all fine today.

I have multiple text files, each containing lists similar to the example shown below:

96467,296466,3  93015,1  4466,1  90721,1  96239,1  96241,1  93024,1

Previously, I merged these lists into a single text file using the command:

copy *.txt merged_file.txt

Now, I want to enhance this process by appending the names of the respective text files next to each item when copying them to the merged file. The desired output format should have each item followed by the name of the file it originated from, separated by a hash sign (#). For clarity, the format should look like this:

96467,2#19.txt  96466,3#19.txt  93015,1#19.txt  4466,1#19.txt 90721,1#KAfa.txt  96239,1#KAfa.txt  96241,1#KAfa.txt  93024,1#KAfa.txt93022,1#Tall.txt

I'd appreciate any assistance in achieving this through a command-line script on a Windows machine.


Viewing all articles
Browse latest Browse all 11294

Trending Articles