請教各位大師,如何用VB(不是VBA) 實作 Unix格式的TXT到Dos格式轉換,希望能幫助提供代碼,感謝!
uj5u.com熱心網友回復:
不一定對,僅供參考:Dim b as Byte
Dim i As Long
Dim ln As Long
Open “dos.txt" for binary access read as #2
Open “unix.txt" for binary access read as #1
lln=LOF(1)
for i=1 to ln
b=inputB(1,#1)
Put #2,,b
if b=vbCr then Put #2,,vbLf
next
Close #1
Close #2
uj5u.com熱心網友回復:
上帖第4行Open “dos.txt" for binary access read as #2
應改為
Open “dos.txt" for binary access write as #2
uj5u.com熱心網友回復:
第6行lln=LOF(1)
應改為
ln=LOF(1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/78323.html
標籤:VB基礎類
