-
-
Save kivanio/7c7708ecd98ada25d03766f0c2fc05a2 to your computer and use it in GitHub Desktop.
Ruby script to convert .mdb db file into .csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export data from Microsoft Access .mdb database into .csv files | |
# using https://github.com/brianb/mdbtools | |
# Install with homebrew - "brew install mdbtools" | |
class ConverterScript | |
tables = `mdb-tables -d , your_db_name.mdb`.chop.split(",") | |
tables.each do |table| | |
exists = system("mdb-export your_db_name.mdb '#{table}'") | |
`mdb-export your_db_name.mdb '#{table}' > #{table.gsub(" ", "_")}.csv` if exists | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment