1

I want to create something like a table in batch. I have 2 files for example.

In first file named names.txt is typed:

John,
Emily,

And in second file named numbers.txt is typed:

78%,
89%,

Now I writed this, but I'm sure that is wrong:

@ECHO OFF
SETLOCAL EnableDelayedExpansion
FOR /F "TOKENS=1 DELIMS=," %%A IN (names.txt,numbers.txt) DO (
ECHO. %%A have %%B.
PAUSE>NUL

I want to see this in console:

John have 78%.
Emily have 89%.

Is this possible? And if it is, how can I do that?

P.S.: I'm sorry for my bad english!

1 Answers1

2
@echo off
setlocal EnableDelayedExpansion

< numbers.txt (
   for /F "delims=," %%a in (names.txt) do (
      set /P number=
      echo %%a have !number:~0,-1!.
   )
)
Aacini
  • 65,180
  • 12
  • 72
  • 108
  • Thanks for the answer, but if I want to use 3 or more files, how can I do? – user3018347 Nov 21 '13 at 18:06
  • 2
    See: [Define a new handle (Similar to STDOUT)](http://stackoverflow.com/questions/19920517/define-a-new-handle-similar-to-stdout/19922932#19922932) – Aacini Nov 21 '13 at 18:46