This should do it, let me know if you need any more logic added.
Main Topics
Browse All TopicsI have two files: one skeleton file that will be used as a base and the second containing the data to be inserted into the new file. So file1 + information from file 2 = file 3. File 1 contains 8 lines of text and two words that have to be replaced by the information in file 2. File 2 contains two columns of data, Source & Destination. There are over 200 lines in file 2, therefore there will be over 200 unique files N.
I'd like to create File N (and all subsequent ones) from file 1 and file 2 using WSH.
File 1:
Stuff Stuff Stuff
Stuff Stuff SOURCE More stuff
More stuff DESTINATION More Stuff
More stuff
File 2:
Source1,Destination1
Source2,Destination2
Source3,Destination3
File N:
Stuff Stuff Stuff
Stuff Stuff SOURCE1 More stuff
More stuff DESTINATION1 More Stuff
More stuff
File N+1:
Stuff Stuff Stuff
Stuff Stuff SOURCE2 More stuff
More stuff DESTINATION2 More Stuff
More stuff
If possible, I'd like to make File N actually be named the Source variable.txt, i.e. source1.txt, source2.txt . . . source200.txt.
Lemme know your thoughts.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
thank you for the rapid responses. My pda web browser is bad so I cannot eval properly. I can modify file 1 to have the words source and destination in it. File 1 is a standard set of instructions and file n and n+1 will only differ with the contents of file 2: rows of data: sourceN,destinationN EOL
thx all
Business Accounts
Answer for Membership
by: JeffPartonPosted on 2009-11-02 at 13:01:04ID: 25723673
Ok, I am sorry but this is vague.
File1: Is it straight text with no carriage returns in it? Is it 8 records? Does it actually have the word "SOURCE" and "DESTINATION" in the text?
File2: Is each line in File2 a record separated by a "," as you seem to have it in your question? So basically 2 fields in the same row?
you show carriage returns in your File N, File 1, File 2 What dicates when you want the line to break?
Can you attach an example of File 1, and an example of File 2 that has the same formatting?
File1 does it contain the "stuff" for File N+1 or does this come from a "different" File1? What creates the separatioin in File1 that can be found to know what belongs to File N or File N+1?
Files can be created this way, but a lot more information needs to be had. Examples of File1 and File2 would be of GREAT benefit.