Computing.Net > Forums > Disk Operating System > Appending Text To Multiple Files

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.

Appending Text To Multiple Files

Reply to Message Icon

Name: Borneo
Date: March 7, 2003 at 23:42:26 Pacific
OS: MS-DOS Mode Multiple Vers
CPU/Ram: K6-2 450mhz / 384mb
Comment:

Howdy...

What I am trying to do I belive is rather
simple. I have several files called talk#.#
and I need to append the same text string
and/or text file to each of them.

The format of the file talk#.# : Where the
first '#' is the channel number which exists
in a range of 0-9999 where the second '#' is
the user number which exist in a range from
1-999 ... The first number '#' isn't really important but I need to be able to change the script to allowe anything in the feild.
Its the last number '#' thats the problem.
I need to be able to append every file that
is named (i.e) talk0.*

The problem with this is I never know which
users will be using the notification system
and I have no way to pass there numbers to
a list for this system.

Is there anyway to append a string of text and/or a text file to every file in a dir
with a simaler name? It seems I did this
years ago but I have tried everything I can
think of and I still can't make it work.

Any ideas or suggestions would be greatly
appreciated. My thanks any advance for any
help that can be offered.

-Borneo



Sponsored Link
Ads by Google

Response Number 1
Name: Miskva
Date: March 8, 2003 at 09:01:26 Pacific
Reply:

This will do the trick

for %f in (talk*.*) do copy %f+textfile.txt %f

this is for command line, if placing into .BAT file, it would be

for %%f in (talk*.*) do copy %%f+textfile.txt %%f


0
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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Appending Text To Multiple Files

FIND in multiple files? www.computing.net/answers/dos/find-in-multiple-files/2165.html

How do I write directly to a file in DOS? www.computing.net/answers/dos/how-do-i-write-directly-to-a-file-in-dos/2394.html

Append to a Line in a .bat file www.computing.net/answers/dos/append-to-a-line-in-a-bat-file/984.html