Re hzy:
There are three ways of thinking about making them output on the same line:
1. Find a way not to output the carriage return:
echo definitely won't work for this. You can try the GNUish commands the moderator mentioned; I personally use oecho.exe. If you can't find any of those, just write one yourself directly in C or assembly, it's simple anyway. Also, debug can write it too. If none of those methods suit your taste, then you can try the following idea.
2. Just use echo to output, then find a way to delete the carriage return:
This is rather tricky. So far I've only seen using debug to reduce the file length by two bytes and then save it again, but this requires knowing the length of the source file in advance, so its use is somewhat limited. In addition, some editing software that supports pipe operations (such as edlin under dos5) or binary string replacement software (such as hexc in the undisk package) can also do this.
echo r cx >delfeed.scr
echo source file length minus 2, then convert it to hexadecimal >> delfeed.scr
echo n sample2.tx>>delfeed.scr
echo s >> delfeed.scr
debug sample1.txt < delfeed.scr
hexc sample1.txt sample2.txt 0d0a ""
3. Directly prepare the needed file in advance instead of outputting it temporarily. This method is suitable when the content of sample1.txt is fixed; using an editor to pre-edit the required header file without a carriage return is not very difficult.
※ Batchinger 致 Bat Fans:请访问
批处理编程的异类 ,欢迎交流与共享批处理编程心得!