zoukankan      html  css  js  c++  java
  • 向txt中插入一行数据

    Set abc = CreateObject("scripting.filesystemobject")
    Set ntxt = abc.opentextfile("C:UsersAdministratorDesktop新建文本文档 (2).txt", 8, True)
    ntxt.writeline """tempname"""
    ntxt.Close
    Set abc = Nothing
    或者
    Dim s As String, t As String, b() As Byte
    s = Join([transpose(char(row(65:75)))], vbCrLf)'""tempname""
    MsgBox s
    Open "C:UsersAdministratorDesktop新建文本文档 (2).txt" For Binary As #1
    ReDim b(LOF(1))
    Get #1, , b
    s = s & vbCrLf & StrConv(b, vbUnicode)
    Put #1, 1, s
    Close #1
    Shell "notepad.exe C:UsersAdministratorDesktop新建文本文档 (2).txt", vbNormalFocus


    //写入数据原来数据会没有
     Open "C:UsersAdministratorDesktop新建文本文档 (2).txt" For Output As #1
         strSQL = """tempname"""
         Print #1, strSQL
       Close #1

  • 相关阅读:
    SRM482
    SRM481
    SRM480
    SRM479
    SRM478
    vue-cli 3 is not a modual err
    .vimrc
    css3 导入字体
    class []的用法
    RK61 Keyboard Use
  • 原文地址:https://www.cnblogs.com/bignine/p/10091019.html
Copyright © 2011-2022 走看看