Jump to content

creating new files from a list?


Guest jim.e.dimoni@bank.of.nigeria.com

Recommended Posts

Guest jim.e.dimoni@bank.of.nigeria.com
Posted

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

  • Replies 3
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: creating new files from a list?

 

 

<jim.e.dimoni@bank.of.nigeria.com> wrote in message

news:a4fnc318gvla2c81qkhh8qe1dar0i45nuh@4ax.com...

>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.

Guest jim.e.dimoni@bank.of.nigeria.com
Posted

Re: creating new files from a list?

 

 

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\)" <I.can@fly.com>

wrote:

>

><jim.e.dimoni@bank.of.nigeria.com> wrote in message

>news:a4fnc318gvla2c81qkhh8qe1dar0i45nuh@4ax.com...

>>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.

>

Guest Pegasus \(MVP\)
Posted

Re: creating new files from a list?

 

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!

 

 

 

<jim.e.dimoni@bank.of.nigeria.com> wrote in message

news:73qoc3tbsd70ag9d4erroqh3fq4psvgcic@4ax.com...

>

> 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\)" <I.can@fly.com>

> wrote:

>

>>

>><jim.e.dimoni@bank.of.nigeria.com> wrote in message

>>news:a4fnc318gvla2c81qkhh8qe1dar0i45nuh@4ax.com...

>>>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.

>>


×
×
  • Create New...