0

I'm looking for a way to run echo and type in one line on DOS batch.

echo [No.1]
type No1.log
echo [No.2]
type No2.log

this script will output like below

[No.1]
No1.log No1.log No1.log No1.log
[No.2]
No2.log No2.log No2.log No2.log

But this is not good for legibility. I want to print like below

[No.1] No1.log No1.log No1.log No1.log
[No.2] No2.log No2.log No2.log No2.log
phuclv
  • 37,963
  • 15
  • 156
  • 475
spending
  • 1
  • 2
  • To print without new line there are already a question, please search and/or look at SO suggestions before asking. For type it depends on the content of the file, so if the file contains a new line obviously you can't type in a single line – phuclv Jun 06 '16 at 03:23

1 Answers1

0

Have you tried reading the content of the log, then concatenating it?

For example, using this to read the log:

set /p log1=<No1.log

Then echo the line:

echo [No.1] %log1%
Community
  • 1
  • 1
xXhRQ8sD2L7Z
  • 1,686
  • 1
  • 14
  • 16