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-08-02 04:39
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Please recommend an expert tool that can work with text files (details inside) View 1,022 Replies 2
Original Poster Posted 2006-10-13 09:59 ·  中国 江苏 苏州 吴江区 电信
初级用户
Credits 100
Posts 39
Joined 2005-10-27 22:50
20-year member
UID 44177
Status Offline
Like this.
Modify some text under DOS, for example:
find the [network] field and add something like domain=111 after that line.
Or replace "windows xp" with "xp"
Or delete only the line that contains the string “cpl.hlp”.
...
In the past I always used echo together with findstr, which was a real hassle, and echo is kind of lousy for that.

I wonder whether you experts can recommend a command-line tool for this, something invoked from the command line, not an editor.
Floor 2 Posted 2006-10-13 12:24 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Why does the term CPL sound so familiar?
CPL — circular polarizing lens, haha...

It seems there isn't any direct internal command with that kind of function :)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 3 Posted 2006-10-14 00:25 ·  中国 江苏 苏州 吴江区 电信
初级用户
Credits 100
Posts 39
Joined 2005-10-27 22:50
20-year member
UID 44177
Status Offline
The built-in findstr in XP can delete lines containing a specific string.
The main problem is that the following functions don't work well when combined with echo.
I just want to achieve these few functions:
1. Delete a specific string without deleting the line containing that string.
2. Replace a specific string.
3. Insert a line after the line containing a specific string, and write specific content into it.

The text handled by echo is very irregular, and GNU sed is too hard to use.

Experts, please a
Forum Jump: