China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-30 18:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Word wrap issue View 2,013 Replies 21
Floor 16 Posted 2007-05-14 10:40 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
Originally posted by lxmxn at 2007-4-28 12:34 AM:
@echo off&Setlocal EnableDelayedExpansion
for /f "delims=" %%a in (1.txt) do (
set str=%%a
set str=!str:换行=$_!
exit|cmd/kprompt !str!>>new_.txt
)


Asking moderator lxmxn, is "$_" a newline character? I don't know the real meaning of cmd /k prompt, and what role it specifically plays.
Floor 17 Posted 2007-05-14 12:29 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Re lililulula:

$_ is not a line feed character, but when used with the prompt command and combined with the exit command, it can achieve the effect of a line break.

For the specific reason, you can search relevant posts by Redtek and Willsort.
Floor 18 Posted 2007-05-14 12:46 ·  中国 广东 广州 番禺区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Hehaha, just solve it with C then.. There are not no simple methods? Why doesn't everyone use them?
知,不觉多。不知,乃求知
Floor 19 Posted 2007-05-14 13:14 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
There is also a simple method!

See the 12th floor of this post.
Floor 20 Posted 2007-05-14 15:44 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
Reply to lxmxn moderator:
I searched, but it seems there is no specific post explaining this. Can you tell me the post title? Also, there is another question: when entering alt+10 in edit to get a line break symbol, why doesn't it display like a backspace character when saved? I wonder if there is any way to solve this.
Floor 21 Posted 2007-05-14 16:10 ·  中国 广东 广州 番禺区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Use a 16-bit editing software to solve it
知,不觉多。不知,乃求知
Floor 22 Posted 2007-05-14 18:11 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Re lililulula:

Refer to the following several posts I searched
http://www.cn-dos.net/forum/viewthread.php?tid=24970
http://www.cn-dos.net/forum/viewthread.php?tid=25707
http://www.cn-dos.net/forum/viewthread.php?tid=24521

Because line breaks are non-visible characters, of course you can't see them. You need to use a special hex editor or other tools to view them.
Forum Jump: