|
leon1982
新手上路

积分 2
发帖 1
注册 2009-6-13
状态 离线
|
|
2009-6-14 06:29 |
|
|
yagoole
新手上路

积分 2
发帖 1
注册 2008-11-26
状态 离线
|
|
2009-8-24 05:08 |
|
|
odv1
初级用户
 
积分 36
发帖 16
注册 2009-8-23
状态 离线
|
|
2009-8-25 05:15 |
|
|
jjww2999
初级用户
 
积分 42
发帖 18
注册 2009-5-13
状态 离线
|
|
2009-10-15 14:29 |
|
|
pzhzshun
新手上路

积分 6
发帖 3
注册 2009-10-10
状态 离线
|
|
2009-10-20 15:54 |
|
|
phlyer
新手上路

积分 16
发帖 8
注册 2009-8-3
状态 离线
|
|
2009-10-28 01:28 |
|
|
qfbest
新手上路

积分 2
发帖 1
注册 2009-8-16
状态 离线
|
『第
52 楼』:
dddddddddddddddddddd
|
|
2009-11-29 17:10 |
|
|
terminal
新手上路

积分 10
发帖 5
注册 2009-12-8
状态 离线
|
|
2009-12-10 15:41 |
|
|
00448011
新手上路

积分 2
发帖 1
注册 2010-1-12
状态 离线
|
|
2010-1-13 04:30 |
|
|
xiaomudou
初级用户
 
积分 31
发帖 16
注册 2007-1-29
状态 离线
|
『第
55 楼』:
下载第一个,谢谢。其实我是放在U 盘做的启动盘上,大小无所谓,只要好用。
|
|
2010-3-17 09:23 |
|
|
chrise
初级用户
 
积分 88
发帖 32
注册 2010-3-27
状态 离线
|
『第
56 楼』:
我也需要一个
回复一下,赚点积分,下一下
|
|
2010-3-28 17:38 |
|
|
ylide
初级用户
 
积分 78
发帖 34
注册 2009-12-1
状态 离线
|
『第
57 楼』:
发个用批处理做的edit代码(XP以上)
我知道这个不符合lz要求,只是发着玩..
运行之后,在编辑状态(提示符为"行号: ")中输入“!control”可进入控制状态(提示符为">")
@echo off
setlocal enabledelayedexpansion
echo.
echo 文本编辑 [版本 1.0.0025]
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 [filename]
echo 保存 save
echo 另存为 saveas [filename]
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 ]
|
|
2010-4-2 10:53 |
|
|
xcgxcg2
新手上路

积分 8
发帖 3
注册 2010-2-2
状态 离线
|
|
2010-4-9 21:28 |
|
|
typuser
新手上路

积分 10
发帖 5
注册 2010-4-10
状态 离线
|
|
2010-4-11 22:04 |
|
|
catamountbit
新手上路

积分 2
发帖 1
注册 2010-4-13
状态 离线
|
|
2010-4-14 10:34 |
|