Convert Microsoft Access File to CSV

It occurs to me that some experiment data (like 10,000,000+ rows) were stored in Microsoft Access DB format, and it is not convenient for data processing.

With some help from StackOverflow, I solved this with this tool mdbtools and export this to csv successfully, thus being able to continue further analysis on this.

The solution is simple (using HomeBrew on macOS):

1
2
3
4
5
#!/bin/bash
for file in $( mdb-tables $1 ); do
echo $file;
mdb-export $1 $file > $2/$file.csv;
done