How to achieve ECHO without Line Wrap
This article is to share with you about how to achieve ECHO line-breaking. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I want to use the batch implementation to import text into s.txt several times, such as "aaaa", "bbbb", "cccc", "dddd".
To achieve the effects in s.txt, such as:
Aaaabbbbccccdddd
However, the echo command forces line breaks every time it is imported, such as:
Aaaa
Bbbb
Cccc
Dddd
How can I achieve the effect I want? Thank you!
Answer:
Echo cannot do this, but you can execute the following statement to achieve your goal
The code is as follows:
> > s.txt set / p = "aaaa" > s.txt set / p = "bbbb" > s.txt set / p = "cccc" > s.txt set / p = "dddd" s.txt
Note 2: for more information about set/p= "aaaa", please see "set Command".
Example 1:
If exist statFile2% (> > statFile2% set/p=,%%i > statFile2% set/p=%%i > b.txt)
For / f% I in ('dir / b% cd%\ eni386\') do (
Echo I > > c.txt
If exist "% cd%\ zhall\ i386\% I" (copy "% cd%\ zhall\ i386\% I"% cd%\ zhI386\"
) else (> > d.txt set / p = "zhall\ i386\% I" > d.txt)
)
Part VI of windows batch processing-echo output does not wrap
Complete case:
Code:
The code is as follows:
@ echo off
Set / p = "hello"