中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 12:22
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » [Discussion] Output the content of the specified line with special characters preserved to the greatest extent possible
Printable Version  21,602 / 32
Floor16 dikex Posted 2007-05-18 14:13
高级用户 Posts 366 Credits 788
Is this okay?? Limited to output

type test.txt>output.txt
Floor17 bjsh Posted 2007-05-18 14:18
银牌会员 Posts 621 Credits 2,000
?
Which post is the post above targeting?

I think when the number of quotation marks is odd, all the content after echo will be output;
Therefore, redirection is not possible;
I think the solution is to escape each quotation mark;

For even numbers, I think there will be no mistakes
Floor18 namejm Posted 2007-05-18 14:23
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Hehe, the code I'm using is not your version, the statement is wrong, I take back this statement.
Floor19 namejm Posted 2007-05-18 14:27
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Unknowingly, bjsh has solved all the output problems of special characters, and the remaining tasks are efficiency improvement and code simplification/standardization.
Floor20 namejm Posted 2007-05-18 14:29
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Originally posted by dikex at 2007-5-18 14:13:
Is this okay?? Only for output

type test.txt>output.txt

  The type method is only limited to the output of the entire text, but what I want to discuss is the original output of all special characters in the content of the specified line. My title is a bit misleading, so I'll change it.
Floor21 bjsh Posted 2007-05-18 14:44
银牌会员 Posts 621 Credits 2,000
Redirect to the code in the text

Notes:
In "call set "var=%%var:"=%%"", the " " in "%%" is not a space but a special character from ctrl+BackSpace;

[ Last edited by bjsh on 2007-5-18 at 02:47 PM ]
Floor22 vkill Posted 2007-05-22 21:00
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
I remember there was a very good solution in the post with the signature of Wuna iHe already!
Floor23 bjsh Posted 2007-05-23 15:56
银牌会员 Posts 621 Credits 2,000
Latest code:
Concise and efficient


Interested people help test
Floor24 namejm Posted 2007-05-23 22:41
荣誉版主 Posts 1,737 Credits 5,226 From 成都
This might be the most concise and efficient code. There's a lot to be done with variable delays.
Floor25 bjsh Posted 2007-05-23 22:56
银牌会员 Posts 621 Credits 2,000
A brief analysis of the subtle relationship among environment variables, special characters for variable delay, and the intermediate method

This is the afterthought of writing the above code.

[ Last edited by bjsh on 2007-11-14 at 12:11 AM ]
Floor26 zjl5 Posted 2007-10-05 05:00
初级用户 Posts 15 Credits 82
I don't know how the effect will be..
Floor27 zzs162 Posted 2008-04-25 05:23
初级用户 Posts 11 Credits 27
Hehe `Not bad` `Admire` ``
Floor28 radem Posted 2008-06-22 00:27
高级用户 Posts 383 Credits 691
Benefited a lot!
But there is still one problem: How to modify the text containing special symbols with P? For example:
Change test.txt
ip 125.219.59.216

sv_contact "568ggstart@163.Com"
// Contact email of the server builder

sv_send_resources 1
// Automatically send resource files included in the *.res file associated with the map to the client

sv_maxrate 25000
// Server maximum transmission rate <0-25000>


to:
ip 59.32.211.105

sv_contact "568ggstart@163.Com"
// Contact email of the server builder

sv_send_resources 1
// Automatically send resource files included in the *.res file associated with the map to the client

sv_maxrate 25000
// Server maximum transmission rate <0-25000>
Floor29 silanger Posted 2008-09-16 20:57
初级用户 Posts 10 Credits 22
It's too profound. It's hard to say not to top it after just reading. But I'm afraid that topping it would make me look like an amateur joining in. Still, I'll top it.
Floor30 laihaibin08 Posted 2008-10-19 17:25
新手上路 Posts 15 Credits 13
Our several moderators are really very talented
Prev  1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023