中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-21 04:55
中国DOS联盟论坛 » DOS软件下载 & 游戏分享 (下载室) » 寻找最小的EDIT.COM 查看 21,973 回复 74
46 发表于 2009-06-14 06:29 ·  中国 北京 联通
新手上路
积分 2
发帖 1
注册 2009-06-13 13:28
17年会员
UID 147332
性别 男
状态 离线
好东西,我也需要。。。
47 发表于 2009-08-24 05:08 ·  中国 上海 宝山区 电信
新手上路
积分 2
发帖 1
注册 2008-11-26 17:48
17年会员
UID 132163
性别 男
状态 离线
我也想下载看看啊,系统崩溃了
48 发表于 2009-08-25 05:15 ·  中国 河南 信阳 联通
初级用户
积分 36
发帖 16
注册 2009-08-23 00:39
16年会员
UID 150800
性别 男
状态 离线
这么小功能够吗?
49 发表于 2009-10-15 14:29 ·  中国 江苏 南京 电信
初级用户
积分 42
发帖 18
注册 2009-05-13 04:48
17年会员
UID 144972
性别 男
状态 离线
顶,我下了第二个.
50 发表于 2009-10-20 15:54 ·  中国 四川 攀枝花 电信
新手上路
积分 6
发帖 3
注册 2009-10-10 20:09
16年会员
UID 152905
性别 男
状态 离线
正好需要,感谢提供。
51 发表于 2009-10-28 01:28 ·  中国 广东 珠海 电信
新手上路
积分 16
发帖 8
注册 2009-08-03 12:09
16年会员
UID 149798
性别 男
状态 离线
多谢,找了好久了。
52 发表于 2009-11-29 17:10 ·  中国 湖北 黄冈 黄州区 电信
新手上路
积分 2
发帖 1
注册 2009-08-16 04:52
16年会员
UID 150450
性别 男
状态 离线
dddddddddddddddddddd
53 发表于 2009-12-10 15:41 ·  中国 广东 深圳 联通
新手上路
积分 10
发帖 5
注册 2009-12-08 15:12
16年会员
UID 156142
性别 男
状态 离线
看看,好像和我的是一样大小吧
54 发表于 2010-01-13 04:30 ·  美国 加利福尼亚州 洛杉矶 南加州大学
新手上路
积分 2
发帖 1
注册 2010-01-12 14:41
16年会员
UID 158517
性别 男
状态 离线
我想要下载~~
55 发表于 2010-03-17 09:23 ·  中国 山东 临沂 兰山区 联通
初级用户
积分 31
发帖 16
注册 2007-01-29 02:02
19年会员
UID 77984
性别 男
状态 离线
下载第一个,谢谢。其实我是放在U 盘做的启动盘上,大小无所谓,只要好用。
56 我也需要一个 发表于 2010-03-28 17:38 ·  中国 陕西 西安 电信
初级用户
积分 88
发帖 32
注册 2010-03-27 14:30
16年会员
UID 163163
性别 男
状态 离线
回复一下,赚点积分,下一下
57 发表于 2010-04-02 10:53 ·  中国 浙江 杭州 电信
初级用户
积分 78
发帖 34
注册 2009-12-01 21:29
16年会员
UID 155755
性别 男
状态 离线
发个用批处理做的edit代码(XP以上)
我知道这个不符合lz要求,只是发着玩..

运行之后,在编辑状态(提示符为"行号: ")中输入“!control”可进入控制状态(提示符为">")


@echo off
setlocal enabledelayedexpansion
echo.
echo 文本编辑
echo Coded by neko, 2010. All rights reserved.

::临时文件设定
set tempfile=%temp%\edit.tmp
::控制入口设定
set ctrcmd=!control
::文件名设定
if not "%1"=="" (set filename=%1
goto EDITOLD)
goto CONTROL

:CONTROL
echo.
:CONTCYCLE
set /p ecmd=">"
for /f "tokens=1" %%i in ("%ecmd%") do set ecmdf=%%i
for /f "tokens=2" %%i in ("%ecmd%") do set ecmd1=%%i
::文件操作
if "%ecmdf%"=="new" (
set filename=新建文本文档.txt
echo.
goto CREATENEW
)
if "%ecmdf%"=="open" (
set filename=!ecmd1!
goto EDITOLD
)
if "%ecmdf%"=="save" (
if exist "!filename!.bak" del "!filename!.bak" /f
if exist "!filename!" move "!filename!" "!filename!.bak"
copy "%tempfile%" "!filename!"
goto EDITOLD
)
if "%ecmdf%"=="saveas" (
set filename=!ecmd1!
if exist "!filename!.bak" del "!filename!.bak" /f
if exist "!filename!" move "!filename!" "!filename!.bak"
copy "%tempfile%" "!filename!"
goto EDITOLD
)
if "%ecmdf%"=="back" (
if "%editstate%"=="CREATE_NEW" set /a line=!line!-1
echo.
goto EDITPARA
)
if "%ecmdf%"=="exit" (
if exist "%tempfile%" del "%tempfile%" /f
goto EOF
)
if "%ecmdf%"=="help" goto HELP
::行操作
if "%ecmdf%"=="insert" goto INSERT
if "%ecmdf%"=="line.insert" goto LINSERT
if "%ecmdf%"=="line.delete" goto LDELETE
if "%ecmdf%"=="line.edit" goto LEDIT
echo '%ecmdf%' 不是有效指令,请键入 help 查询控制命令。
echo.
goto CONTCYCLE

:NOPEN
echo 未打开任何可编辑的文件。
goto CONTROL

:NOLINE
echo 指定行数不存在。
goto CONTROL

:HELP
echo.
echo 新建 new
echo 打开 open
echo 保存 save
echo 另存为 saveas
echo 返回 back
echo 退出 exit
echo 帮助 help
echo.
echo 插入段 insert
echo 插入行 line.insert
echo 删除行 line.delete
echo 编辑行 line.edit
goto CONTROL

:INSERT
if "!filename!"=="" goto NOPEN
if !ecmd1! LEQ 0 goto NOLINE
set /a line=!line!+1
if !ecmd1! GTR !line! goto NOLINE
echo.
if exist "%tempfile%.1" del "%tempfile%.1" /f
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! LSS !ecmd1! echo %%i>>"%tempfile%.1"
)
set /a line=!ecmd1!-1
:INSPARA
set /a line=!line!+1
set /p cLine="%line%: "
if not "%cLine%"=="%ctrcmd%" (
echo ^%cLine%>>"%tempfile%.1"
goto INSPARA)
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! GEQ !ecmd1! echo %%i>>"%tempfile%.1"
)
if exist "%tempfile%" del "%tempfile%" /f
move "%tempfile%.1" "%tempfile%"
goto EDITCUR

:LINSERT
if "!filename!"=="" goto NOPEN
if !ecmd1! LEQ 0 goto NOLINE
if !ecmd1! GTR !line! goto NOLINE
echo.
set /p cLine="!ecmd1!: "
if exist "%tempfile%.1" del "%tempfile%.1" /f
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! LSS !ecmd1! echo %%i>>"%tempfile%.1"
if !line! EQU !ecmd1! echo ^%cLine%>>"%tempfile%.1"
)
set /a ecmd1=!ecmd1!-1
for /f "skip=%ecmd1% tokens=*" %%i in (%tempfile%) do echo %%i>>"%tempfile%.1"
if exist "%tempfile%" del "%tempfile%" /f
move "%tempfile%.1" "%tempfile%"
goto EDITCUR

:LDELETE
if "!filename!"=="" goto NOPEN
if !ecmd1! LEQ 0 goto NOLINE
if !ecmd1! GTR !line! goto NOLINE
echo.
if exist "%tempfile%.1" del "%tempfile%.1" /f
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! LSS !ecmd1! echo %%i>>"%tempfile%.1"
if !line! GTR !ecmd1! echo %%i>>"%tempfile%.1"
)
if exist "%tempfile%" del "%tempfile%" /f
move "%tempfile%.1" "%tempfile%"
goto EDITCUR

:LEDIT
if "!filename!"=="" goto NOPEN
if !ecmd1! LEQ 0 goto NOLINE
if !ecmd1! GTR !line! goto NOLINE
echo.
if exist "%tempfile%.1" del "%tempfile%.1" /f
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! EQU !ecmd1! echo !ecmd1!: %%i
)
set /p cLine="!ecmd1!: "
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
if !line! LSS !ecmd1! echo %%i>>"%tempfile%.1"
if !line! EQU !ecmd1! echo ^%cLine%>>"%tempfile%.1"
if !line! GTR !ecmd1! echo %%i>>"%tempfile%.1"
)
if exist "%tempfile%" del "%tempfile%" /f
move "%tempfile%.1" "%tempfile%"
goto EDITCUR

:CREATENEW
echo.
echo 创建文本 - !filename!
echo.
set /a line=0
if exist "%tempfile%" del "%tempfile%" /f
set editstate=CREATE_NEW
:CRTPARA
set /a line=!line!+1
set /p cLine="%line%: "
if "%cLine%"=="%ctrcmd%" goto CONTROL
echo ^%cLine%>>"%tempfile%"
goto CRTPARA

:EDITOLD
if not exist "!filename!" (
echo 文件 '!filename!' 不存在。
goto CONTROL
)
if exist "%tempfile%" del "%tempfile%" /f
for /f "tokens=*" %%i in (!filename!) do echo %%i>>"%tempfile%"
:EDITCUR
echo.
echo 编辑文本 - !filename!
echo.
set /a line=0
for /f "tokens=*" %%i in (%tempfile%) do (set /a line=!line!+1
echo !line!: %%i)
goto CONTROL

:EOF
if exist "%tempfile%" del "%tempfile%" /f
set tempfile=
set ctrcmd=
set filename=
set editstate=
set line=
set cLine=
set ecmd=
set ecmdf=
set ecmd1=


[ Last edited by ylide on 2010-4-2 at 10:56 ]
58 发表于 2010-04-09 21:28 ·  中国 湖南 怀化 电信
新手上路
积分 8
发帖 3
注册 2010-02-02 21:02
16年会员
UID 159988
性别 男
状态 离线
有一个dos下就8k,要就联系我xcgxcg2@126.com
59 发表于 2010-04-11 22:04 ·  中国 河北 保定 电信
新手上路
积分 10
发帖 5
注册 2010-04-10 21:47
16年会员
UID 164274
性别 男
状态 离线
学习中!
60 发表于 2010-04-14 10:34 ·  中国 北京 光环新网电信数据中心
新手上路
积分 2
发帖 1
注册 2010-04-13 11:18
16年会员
UID 164470
性别 男
状态 离线
谢谢啊,正想用一下呢
论坛跳转: