Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Personally, I wouldn't spend a whole lot of time fussing around trying to get <code>mdbtools</code>, <code>unixODBC</code> and <code>pyodbc</code> to work together. As Pedro suggested in his comment, if you can get <code>mdb-export</code> to dump the tables to CSV files then you'll probably save a fair bit of time by just importing those CSV files into SQLite or MySQL, i.e., something that will be more robust than using <code>mdbtools</code> on the Linux platform.</p> <p>A few suggestions:</p> <ol> <li><p>Given the sheer number of <code>.mdb</code> files (and hence <code>.csv</code> files) involved, you'll probably want to import the CSV data into one big table with an additional column to indicate the source filename. That will be much easier to manage than ~2000 separate tables.</p></li> <li><p>When creating your target table in the new database you'll probably want to use a <code>decimal</code> (as opposed to <code>float</code>) data type for the [Time] column.</p></li> <li><p>At the same time, rename the [Cycle#] column to just [Cycle]. "Funny characters" in column names can be a real nuisance.</p></li> </ol> <p>Finally, to select the "last" reading (largest [Time] value) for a given [SourceFile] and [Cycle] you can use a query something like this: </p> <pre><code>SELECT v1.SourceFile, v1.Cycle, v1.Time, v1.Data FROM Voltage v1 INNER JOIN ( SELECT SourceFile, Cycle, MAX([Time]) AS MaxTime FROM Voltage GROUP BY SourceFile, Cycle ) v2 ON v1.SourceFile=v2.SourceFile AND v1.Cycle=v2.Cycle AND v1.Time=v2.MaxTime </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload