|Thanks for explaining, Razor. No offence please at my attempt to extend our positive discussion (I know little about DOS and I am just trying to learn batch files). While searching for the answer and experimenting I came across this link.|
Accordingly, batch file with the following code was created and run. It tries to dump the outputs of echo statements both on the command prompt window as well as to a file named newline.txt. Interestingly (but irritatingly enough), the output on the cmd window shows line breaks where expected, but the text redirected to newline.txt does not show up as expected.:-
REM deleting previous contents of file named newline.txt, if any
REM Creating a Newline variable (the two blank lines are required!)
@echo There should be a newline%NL%inserted here.
@echo There should be a newline%NL%inserted here.>>newline.txt
REM method3 (although without the use of a variable):
And moreover, i could not understand the creation and working of the NL variable in method1. Any help would be appreciated.