Sub excel连接数据库() Dim Con As New ADODB.Connection Dim strCon, strsql As String Dim rs As ADODB.Recordset '设置记录集 Dim i, t, path_ path_ = ThisWorkbook.path & "\" t = Timer 连接字符串 strCon = "Provider=Microsoft.Ace.OLEDB.12.0;Extended Properti
1.读取txt文件 注意事项: 1..txt文件同下方脚本所在的.py文件需要在同一个文件夹下 # coding=utf-8 txt读取 with open("1233.txt") as file: for line in file: print(line) 2.读取csv文件 注意事项: 1).csv文件同下方脚本所在的.py文件需要在同一个文件夹下 2).csv文件由来必须是,创建完excel文件后另存为csv文件,如果只是修改后缀名读取是不能成功读到csv文件中的内容的. # c