Link to home
Start Free TrialLog in
Avatar of Barbulescu
BarbulescuFlag for Romania

asked on

read 2 text files and write to the 3rd one

I have 2 text files:

TextFile1.txt contains only one entry
TextFile2.txt contains multiple entries, unknown number

I would like a script (I am open to the most feasible suggestions) that will write in TextFile3.txt as follows:

TextFile_1_Entry1 TextFile2_Entry_1
TextFile_1_Entry1 TextFile2_Entry_2
TextFile_1_Entry1 TextFile2_Entry_3
TextFile_1_Entry1 TextFile2_Entry_4
.
.
.
.
TextFile_1_Entry1 TextFile2_Entry_n

Basically, in excell this can be done with the following function:
=PROPER(A21&" "&B21)

I am looking for a batch script or other form of script that I could execute in the folder which contains TextFile1 and TextFile2 , a scrip that will write the output in TextFile3 by default.

Thank you!
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Can you upload two sample text files? The files should closely represent the actual data.
Avatar of Barbulescu

ASKER

Hi

Attached you can find the sample files.

Thank you!
Temp.zip
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you need a VBS or powershell script let me know.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow, so simple,  I had kind of written batch files off a while ago.  

Perhaps they are worth a second look.
Avatar of Bill Prew
Bill Prew

Yes, they can be quite powerful once you get some of the basic building blocks down.

~bp
Thank you for your support.
Welcome, glad that was useful, thanks for the feedback.

~bp