Re: [問題] 這樣的需求得要自己寫程式嗎?
※ 引述《buniro.bbs@ptt.cc (期待2008!)》之銘言:
> 有一個2MB多的Unicode純文字檔,當中有很多重覆的字串"1"、"2"、"3"..."200",
> 如果想將"85"之後的字串其數值都+1,也就是處理後"1"~"84"不變,"85"變"86"、
> "86"變"87"...."200"變"201",那麼這有什麼現成的Editor可以使用嗎?
用現成的Excel讀進來
1)移到B85格
2)再輸入"=A85+1",然後複製到下面各列
3)把游標移到B欄欄頭上按右鍵,用「選擇性貼上」貼上「值」
4)刪除A欄
5)存為文字檔
> 還是非得自己寫個程式來處理?
> 如果只能自己寫的話,各位板友建議用哪一種語言寫,對初學者來說比較容易?
VBA.
sub abcdefghijk()
open "FILE1.txt" for input as #1
open "FILE1_PRIME.txt" for output as #2
Lnumber=1
while not eof(1)
input #1, s
if Lnumber>=85 then print #2, val(s)+1 else print #2, s
Lnumber=Lnumber+1
wend
close #2
close #1
kill "FILE1.txt"
name "FILE1_PRIME.txt" as "FILE1.txt"
end sub
一般而言,大家都只把摺凳拿來坐。Office也是這樣。
--
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
For the country must we secure all the advantages, but after the party!
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
─ journeyman ─
SCA v2
--
┌─────◆KKCITY◆─────┐▇─┐KKADSL→六星級優質連線服務
│ bbs.kkcity.com.tw │┴ └─▇ 馬上申請帶你上網環遊全世界!
└──《From:218.160.84.199 》──┘ KKADSL ┴ http://adsl.kkcity.com.tw
--
討論串 (同標題文章)
完整討論串 (本文為第 4 之 17 篇):