回复 9楼 冬瓜汤
用grep和awk,不重复的800万找800万也只要7秒[此贴子已经被作者于2023-2-5 16:39编辑过]
[此贴子已经被作者于2023-2-5 16:39编辑过]
Private Sub 表1导入数据() Dim Con As New ADODB.Connection With Con .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\数据条件源.mdb;Persist Security Info=False" .Open '打开数据库 .Execute ("insert into 表1 SELECT * FROM [text;HDR=no;Database=F:\].[DATA.txt];") End With End Sub
Sub Main() Dim con Set con = CreateObject("ADODB.Connection") con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='text;HDR=NO';Data Source=D:\temp\test\vb-数据导入\" con.Open Dim rec, field Set rec = CreateObject("ADODB.Recordset") rec.Open "SELECT * FROM aaa.txt", con, 1, 3, 1 rec.MoveFirst Do While Not rec.EOF() For Each field In rec.fields Debug.Print field.Value Next rec.MoveNext Loop rec.Close con.Close End Sub