Computing.Net > Forums > Programming > Append multiple files, add $ between each one

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Append multiple files, add $ between each one

Reply to Message Icon

Name: rmx101
Date: June 9, 2009 at 12:58:34 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Goal: Create one file with contents of multiple text files + insert a $ between each file.

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

new.txt should have:
abcd
$
1234

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!



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: June 9, 2009 at 13:15:11 Pacific
Reply:

Question already solved one billion times...

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


0

Response Number 2
Name: rmx101
Date: June 22, 2009 at 11:18:14 Pacific
Reply:

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

output.new = abc$xyz

current suggesttion creates output.new =
abc
$
xyz


0

Response Number 3
Name: Mechanix2Go
Date: June 22, 2009 at 12:32:22 Pacific
Reply:

"current suggesttion creates output.new =
abc
$
xyz"

Yep, which is exactly what you asked for.


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

M2


0

Response Number 4
Name: rmx101
Date: July 9, 2009 at 06:49:44 Pacific
Reply:

Here's what I am looking for:

abc$xyz

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!



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Append multiple files, add $ between each one

Copy multiple files with a delay between each www.computing.net/answers/programming/copy-multiple-files-with-a-delay-between-each/19958.html

Waiting between batch files www.computing.net/answers/programming/waiting-between-batch-files/18845.html

Bat file to check for multiple files www.computing.net/answers/programming/bat-file-to-check-for-multiple-files/19129.html