VB 读取文本内容第一行后 并删除第一行

VB 读取文本内容第一行后 并删除第一行
D:\1.txt 文本内容如下:

|白光|009
|蓝光|12
|无彩|270

声明:分隔符号|是固定的,不能换。
期待高手给个现成的代码,谢谢
试了还是用不了啊

恳求高手提供按键精灵上能用的代码,要删除“|”分隔符的代码。

第1个回答  2010-02-07
redim a(i)
s=1
open "d:\aa.txt" for input as #1
do while not eof(1)
input #1 , a(i)
if s=1 then
s=2
a(i)=""
end if
if a(i) <> "" then
text1.text=text1.text & a(i) & chr (13) & chr (10)
end if
loop本回答被提问者和网友采纳
第2个回答  2010-02-08
Dim linetxt As String, alltxt As String, n As Long
Open "D:\1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, linetxt
n = n + 1
If n = 1 Then
MsgBox linetxt
Else
alltxt = alltxt & linetxt & vbCrLf
End If
Loop
Close #1
Kill "D:\1.txt"
Open "D:\1.txt" For Binary As #1
Put #1, , alltxt
Close #1
相似回答