中国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-08-26 23:48
47,812 topics / 349,912 posts / today 2 new / 48,264 members
其它操作系统综合讨论区 » How to perform case conversion?
Printable Version  1,608 / 9
Floor1 rubik Posted 2006-04-13 13:09
初级用户 Posts 35 Credits 102
For example, if you get a variable using set /p, how to unconditionally convert the value of the variable to uppercase?
Floor2 Climbing Posted 2006-04-13 17:38
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
Using 26 commands:
set var=%var:a=A%
set var=%var:b=B%
...
set var=%var:z=Z%

Can achieve the function of the original poster. I only have this clumsy way.
Floor3 rubik Posted 2006-04-13 23:17
初级用户 Posts 35 Credits 102
Floor4 smileseeker Posted 2006-04-14 17:19
中级用户 Posts 83 Credits 316
I don't know if there are any small software that can realize the conversion of the case of the entire document
Floor5 DOSforever Posted 2006-04-14 17:40
金牌会员 Posts 2,239 Credits 4,639
Floor6 无奈何 Posted 2006-04-14 20:07
荣誉版主 Posts 356 Credits 1,338
TO smileseeker

GNU sed can conveniently convert the case of files.

Lowercase: sed "s/\(.*\)/\L\1/" file.txt

Uppercase: sed "s/\(.*\)/\U\1/" file.txt

sed download address: http://www.student.northpark.edu/pemente/sed/gsed407x.zip
Floor7 smileseeker Posted 2006-04-15 08:20
中级用户 Posts 83 Credits 316
Thanks a lot.

The younger brother will first try it out.
Floor8 HUNRYBECKY Posted 2007-01-25 06:01
银牌会员 Posts 442 Credits 1,179
Recently, I found that the DOS version of WINRAR, RAR, has this function. The parameters are rar -cl to convert to uppercase and rar -cu to convert to lowercase.
Floor9 simazhuo Posted 2007-01-25 11:14
新手上路 Posts 2 Credits 1
Thanks for the share from the person above!
Floor10 lxmxn Posted 2007-01-25 12:12
版主 Posts 4,938 Credits 11,386
Originally posted by HUNRYBECKY at 2007-1-24 17:01:
Recently, I found that the DOS version of WINRAR, RAR, has this function. The parameters are rar -cl to convert to uppercase and rar -cu to convert to lowercase.


  This can only convert the case of file names, and cannot batch convert the content of files to uppercase or lowercase, right?
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023