PC Review


Reply
Thread Tools Rate Thread

creating new files from a list?

 
 
jim.e.dimoni@bank.of.nigeria.com
Guest
Posts: n/a
 
      22nd Aug 2007
I have a TEMPLATE.PUB file.

I have a .TXT file with a list of names

I would like to create copies of the template file with the names in
the TXT file as the filename.

Is there a simple way to automate this?

thx
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      22nd Aug 2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a TEMPLATE.PUB file.
>
> I have a .TXT file with a list of names
>
> I would like to create copies of the template file with the names in
> the TXT file as the filename.
>
> Is there a simple way to automate this?
>
> thx


You could run this command from a Command Prompt:

for /F %a in (Files.txt) do copy /y Template.pub %a

It is possible to further automate the process by embedding
this command in a batch file.


 
Reply With Quote
 
jim.e.dimoni@bank.of.nigeria.com
Guest
Posts: n/a
 
      22nd Aug 2007

THX, works fine.

For my education can u give me a short explanation

/F
%a
/y

and why does Files.txt have to be in parens?

thx again

On Wed, 22 Aug 2007 07:34:20 +0200, "Pegasus \(MVP\)" <(E-Mail Removed)>
wrote:

>
><(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>>I have a TEMPLATE.PUB file.
>>
>> I have a .TXT file with a list of names
>>
>> I would like to create copies of the template file with the names in
>> the TXT file as the filename.
>>
>> Is there a simple way to automate this?
>>
>> thx

>
>You could run this command from a Command Prompt:
>
>for /F %a in (Files.txt) do copy /y Template.pub %a
>
>It is possible to further automate the process by embedding
>this command in a batch file.
>

 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      22nd Aug 2007
Ok, here we go:

for /F %a in (Files.txt) do copy /y Template.pub %a

the /F switch broadly means that the "for" command
should select something from a file or from a set of
files. Type for /? at the Command Prompt to see a
few examples.

%a is a variable that assumes different values while
the command is looping. Type the following command
to see what I mean:

for %a in (Tom Dick Harry) do @echo My name is %a.

I won't tell you what the /y switch means. Type copy /?
at the Command Prompt to see for yourself!



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> THX, works fine.
>
> For my education can u give me a short explanation
>
> /F
> %a
> /y
>
> and why does Files.txt have to be in parens?
>
> thx again
>
> On Wed, 22 Aug 2007 07:34:20 +0200, "Pegasus \(MVP\)" <(E-Mail Removed)>
> wrote:
>
>>
>><(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>>I have a TEMPLATE.PUB file.
>>>
>>> I have a .TXT file with a list of names
>>>
>>> I would like to create copies of the template file with the names in
>>> the TXT file as the filename.
>>>
>>> Is there a simple way to automate this?
>>>
>>> thx

>>
>>You could run this command from a Command Prompt:
>>
>>for /F %a in (Files.txt) do copy /y Template.pub %a
>>
>>It is possible to further automate the process by embedding
>>this command in a batch file.
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Recent Files List Anil Gupte Microsoft VB .NET 2 16th Jan 2008 03:03 PM
Creating a List of the files in a folder in excel PatRyan22@gmail.com Microsoft Excel Misc 2 27th Nov 2006 08:39 PM
Re-creating tables from a list of files Dion Warren Microsoft Access Database Table Design 2 30th Sep 2004 08:24 PM
In creating a link I can't get a list of the files in my web - Please Help! M.Siler Microsoft Frontpage 4 15th Mar 2004 10:00 PM
Re: Creating a list of found files Tom Ogilvy Microsoft Excel Programming 1 1st Oct 2003 08:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:24 AM.