Batch file - concatenate two .txt files to one

Viewed 134

I have some difficulties concatenating two text files. First text file

Document1
Document2
Document3

Second text file

456
233
100

What I want to know is how to concatenate them in another text file so that so they can be seen this way

Document1-456
Document2-233
Document3-100

I have this code but it does not work as I want

@echo off
Set f1=file1.txt
set f2=file2.txt

FOR /F "Delims=" %%A in ('TYPE %f1%') DO (
    FOR /F "Delims=" %%B in ('TYPE %f2%') DO (
        echo.%%A-%%B >>newfile.txt
    )
)

I hope you can help me

1 Answers
Related