I have a request for some contract work from an organization that uses Excel as a database and wants to do some work on the Excel data via a real database. (Yeah, I know, ne
You don't specify a language, so if you are language agnostic .Net gives you some very powerful classes for data handling:
to open a csv file:
Imports System.Data.OleDb, Imports Excel = Microsoft.Office.Interop.Excel
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DataFolder + "\;Extended Properties='text;HDR=Yes'"
Dim conn As New System.Data.OleDb.OleDbConnection(ConnectionString)
conn.Open()
Dim CommandText As String = CommandText = "select * from [" + CSVFileName + "]"
If Filter.Length > 0 Then
CommandText += " WHERE " + Filter
End If
Dim daAsset As New OleDbDataAdapter(CommandText, conn)
Dim dsAsset As New DataSet
daAsset.Fill(dsAsset, "Asset")
opening a sheet in a workbook is very similar - you specify the sheet name and can then fill a DataSet with the entire sheet - you can then access the Tables().Rows() of the DataSet to get each row and field, iterate over every row etc.