看板Programming
标 题Re: [问题] 这样的需求得要自己写程式吗?
发信站KKCITY (Thu Sep 27 01:31:35 2007)
转信站ptt!ctu-reader!ctu-gate!news.nctu!news.ntu!news.au!zoonews.ee.ntu!news
※ 引述《[email protected] (期待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
--