分享

VB中读取文本文件中的每一行,处理后写入另一个文本文件

 hdzgx 2019-10-16
Private Sub Command1_Click()
Open App.Path + "\1.txt" For Input As #1
Open App.Path + "\2.txt" For Binary As #2


Do While Not EOF(1)
Dim tmp, tmp2 As String
Dim l As Long
Line Input #1, tmp
l = InStr(1, tmp, "name")
tmp2 = Mid(tmp, 1, l - 1) & "name" & 你的函数ABC(Mid(tmp, l + 4)) & vbCrLf
Put #2, , tmp2
Doevents '防程序卡死
Loop

Close #1
Close #2
End Sub

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多