PC Review


Reply
Thread Tools Rate Thread

Create Files from a List of File Names

 
 
melissa_4011@yahoo.com
Guest
Posts: n/a
 
      1st May 2007
Hi,

I'm working with batch files and I am trying to create single separate
text files from a list of names that I have. For example, let's say I
have a text file (or CSV, etc) with the names:

red
orange
blue

I want the batch file to output a new file named red.txt; a new file
named orange.txt; and a new file named blue.txt

Is this possible?

Any input would be appreciated.

Thanks

 
Reply With Quote
 
 
 
 
Bob I
Guest
Posts: n/a
 
      1st May 2007
You would need some thing to put in the file.
create a text file that you will use for the base then


Copy base.txt red.txt
Copy base.txt orange.txt
Copy base.txt blue.txt

(E-Mail Removed) wrote:

> Hi,
>
> I'm working with batch files and I am trying to create single separate
> text files from a list of names that I have. For example, let's say I
> have a text file (or CSV, etc) with the names:
>
> red
> orange
> blue
>
> I want the batch file to output a new file named red.txt; a new file
> named orange.txt; and a new file named blue.txt
>
> Is this possible?
>
> Any input would be appreciated.
>
> Thanks
>


 
Reply With Quote
 
Ayush
Guest
Posts: n/a
 
      1st May 2007
[(E-Mail Removed)]s message :
> Hi,
>
> I'm working with batch files and I am trying to create single separate
> text files from a list of names that I have. For example, let's say I
> have a text file (or CSV, etc) with the names:
>
> red
> orange
> blue
>
> I want the batch file to output a new file named red.txt; a new file
> named orange.txt; and a new file named blue.txt
>


try this:
for /f "tokens=*" %%l in (x.txt) do @type nul > "%%l.txt"

warning: this will overwrite any existing files with same name!


Good Luck, Ayush.
--
XP-Tips [Auto logon for Windows XP] :
http://www.microsoft.com/windowsxp/u...autologon.mspx
 
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
How to create a list of media files names in excel. =?Utf-8?B?am95ZTY4?= Microsoft Excel Misc 2 9th Jul 2007 05:12 AM
create a list of worksheet names (from a single folder, or open files) Drew Microsoft Excel Misc 2 15th Apr 2005 04:58 PM
Re: How can I create a list of file names in MS Word? Paul Ballou Microsoft Powerpoint 0 16th Sep 2004 04:10 PM
Re: How can I create a list of file names in MS Word? Sonia Microsoft Powerpoint 0 16th Sep 2004 04:09 PM
How can I create a list of file names in MS Word? =?Utf-8?B?bGlzdCBvZiBmaWxlcyBpbiBNUyBXb3Jk?= Microsoft Powerpoint 0 16th Sep 2004 03:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:16 PM.