Reputation: 73
Does someone knows how to create a file .txt on CMD?, I need like an order or steps to create it; I see that i need to write {echo "text"> "name".txt} but, i mean the content has not order and sometimes it doesn´t respond correctly.
Thank you guys Well, I know that I was not so clearly 'bout what I wanted to do, and I'm sorry, but, your advices also help me alot, so, Thank u.
Upvotes: 7
Views: 29645
Reputation: 8253
Easy way to do this
echo "abcdef" > a.txt
echo "12345" >> a.txt
the a.txt content will be
"abcdef"
"12345"
Upvotes: 5
Reputation: 328
Try creating a variable with the text first like as follows:
set /p txt=Your Text Content;
echo %txt% > "Location\textfile.txt"
EDIT: If you are meaning that the newline doesnt appear all you have to do is the following:
echo "FirstLine" > "Location\textfile.txt"
echo. "SecondLine" > "Location\textfile.txt"
echo. instead of echo will start a new line.
Upvotes: 3