作者dearaquarius (乱青春)
看板CodeJob
标题[发案] DOS档案字串处理
时间Wed Jul 20 14:22:56 2016
凡是「*[30m」开始的行,都请使用 Ctrl + y 删除。
如果对於发案文章格式有不清楚的地方,请参考置底文章:[发案] 发案范例
发案人:吴先生
联络方式1:Line:dearaquarius
联络方式2:站内信
所在地区 :桃园
有效时间:7/24
专案说明:
功能a. 搜寻字串出现次数 并设定参数 set Str_Count=QTY
功能b. 将搜寻字串内容做替换 (若有重复可指定第几个 无指定则全部替换)
功能c. 将搜寻字串後的内容 并指定byte做替换
功能d. 将搜寻字串後的内容 指定byte设定成参数 set Str_par=Parameter
功能e. 算术计算 加减乘除, 开根号
功能f. 指定行数 删除/插入 内容
功能G. 指定位置 删除/插入 内容
Ex:
File name Test.txt
======================================
apple:12345
beer
cat
dog
apple:45678
beer
cat
apple:13579
======================================
a. 执行 FileTool /sq Test.txt "apple"
echo %Str_Count%
结果 3
b. 执行 FileTool /r Test.txt Test2.txt "apple" "APPLE"
Type Test2.txt
结果
APPLE:12345
beer
cat
dog
APPLE:45678
beer
cat
APPLE:13579
c. 执行 FileTool /rb 2-3 Test.txt Test2.txt 3 "apple:" 246810
Type Test2.txt
结果
apple:12345
beer
cat
dog
apple:45678
beer
cat
apple:124681079
d. 执行 FileTool /par 2-3 Test.txt 3 "apple:"
echo %Str_par%
结果 35
e. 执行 FileTool /cal "(123+15/5)*2"
echo %Str_Cal%
结果 63
f. 执行 FileTool /del_row 3 Test.txt Test2.txt
Type Test2.txt
结果
apple:12345
beer
dog
apple:45678
beer
cat
apple:246810
执行 FileTool /ins_row 3 Test.txt Test2.txt "ZooZooZoo"
Type Test2.txt
结果
apple:12345
beer
ZooZooZoo
dog
apple:45678
beer
cat
apple:246810
g. 执行 FileTool /del_pos 3-8 Test.txt Test2.txt
Type Test2.txt
结果
ap345
beer
dog
apple:45678
beer
cat
apple:246810
执行 FileTool /ins_pos 3 Test.txt Test2.txt "ZooZooZoo"
Type Test2.txt
结果
apZooZooZoople:12345
beer
ZooZooZoo
dog
apple:45678
beer
cat
apple:246810
预算:口袋不深 请报价
接案者要求:
附注:
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 210.61.122.2
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/CodeJob/M.1468995779.A.F6C.html
1F:→ p2k: 环境是纯 DOS 还是 Windows 下的 CMD 视窗? 07/20 23:00
3F:推 shadowjohn: e 的执行结果应该为 252 请确认一下 ? 07/21 00:37
4F:推 shadowjohn: 已完成~可跟我联络XD 07/21 00:51
5F:→ shadowjohn: 花了2小时…前半部研究env真搞工 07/21 00:53
※ 编辑: dearaquarius (210.61.122.2), 07/21/2016 12:01:18