Append multiple files, add $ between each one

June 9, 2009 at 12:58:34
Specs: Windows XP
Goal: Create one file with contents of multiple text files + insert a $ between each file.

a.txt has content .. abcd
b.txt has content .. 1234

new.txt should have:

Looking for a batch file that would achieve this for an entire directory.

I can successfully create one file with the content of all files with a simple copy command, but do not know how to insert a $ sign between content of each file.

thanks in advance!

See More: Append multiple files, add $ between each one

Report •

June 9, 2009 at 13:15:11
Question already solved one billion times...

:: JOINTXT.BAT Usage: jointxt Folder_Name
@echo off >
pushd %*
for %%j in (*.txt) do (
  type "%%j"
) >>
ren output.txt
:: End_Of_Batch

Report •

June 22, 2009 at 11:18:14
thanks for this post.. Problem is that after appending $, there is a line break. I want to insert a $ sign as per this example:

file1 = abc
file2 = xyz = abc$xyz

current suggesttion creates =

Report •

June 22, 2009 at 12:32:22
"current suggesttion creates =

Yep, which is exactly what you asked for.

If at first you don't succeed, you're about average.


Report •

Related Solutions

July 9, 2009 at 06:49:44
Here's what I am looking for:


where abc = file1, $ = delimeter, xyz=file2

Please note, previous suggestions resulted in a linebreak before / after the delimeter. I am looking for an output with No line break. Thanks!

Report •

Ask Question