2

I have been searching for hours now and didn't find a solution yet.

This is the whole command with a loop:

for /L %a in (1, 1, 3) do call echo ^<center^> >indeex%a.html

Output results (*Without any text in them):*

indeex1.html

indeex2.html

indeex3.html

I tried the other way with quotes, it worked but it included the quotes in the output files.(without carrot signs)

for /L %a in (1, 1, 3) do call echo "<center>" >indeex%a.html

When I try the same code with carrot signs but without loops, it actually works.

echo ^<center^> >file.html

My question is how to make it work with a loop? Because I need to make 100 files with the same HTML code in them.

4
  • What do you want it to output? Commented Oct 25, 2013 at 12:55
  • I need to make 100 files with the same HTML code in them. But the problem is that it outputs quotes if i use quotes in echo command, when i use carrot signs before '<' '>' symbols it outputs a blank file ( when i use loops) but without loops it works. Commented Oct 25, 2013 at 12:59
  • Do you need ^ in your file? Commented Oct 25, 2013 at 13:01
  • No I don't need ^ in file. When I work with a single file: echo ^<center^> >file.html the final result in the file.html (output) is: <center> and it works, but it doesn't with the loops.. Commented Oct 25, 2013 at 13:04

1 Answer 1

4
for /L %a in (1, 1, 3) do echo ^<center^> >indeex%a.html
Sign up to request clarification or add additional context in comments.

2 Comments

Could you tell me where was my problem?
I got rid of the "call".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.