[發案] DOS檔案字串處理(已結案)

看板CodeJob作者 (亂青春)時間9年前 (2016/07/20 14:22), 9年前編輯推噓3(302)
留言5則, 2人參與, 最新討論串1/1
凡是「*[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://www.ptt.cc/bbs/CodeJob/M.1468995779.A.F6C.html

07/20 23:00, , 1F
環境是純 DOS 還是 Windows 下的 CMD 視窗?
07/20 23:00, 1F

07/20 23:44, , 2F
07/20 23:44, 2F

07/21 00:37, , 3F
e 的執行結果應該為 252 請確認一下 ?
07/21 00:37, 3F

07/21 00:51, , 4F
已完成~可跟我聯絡XD
07/21 00:51, 4F

07/21 00:53, , 5F
花了2小時…前半部研究env真搞工
07/21 00:53, 5F
※ 編輯: dearaquarius (210.61.122.2), 07/21/2016 12:01:18
文章代碼(AID): #1NZnZ3zi (CodeJob)