i've got two csv files that i want to merge. Basically, i've got my source file, and the second file will add information to that file using a primary key that they both share.
I've done this using v-lookup but since this will be a weekly process,开发者_高级运维 i want to automate it using vb.net or C#. any ideas?
Thanks
It is quite possible to use SQL with CSV files in either vb.net or c#.
Some notes:
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\docs\;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""
cn.Open()
cmd.Connection = cn
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT a.PK, b.SText,a.[Processor Time] INTO BookX.csv " & _
"FROM [Book1.CSV] a " & _
"LEFT JOIN [Book2.CSV] b " & _
"ON a.PK = b.PK"
精彩评论