Last active
December 11, 2015 02:38
-
-
Save eedrummer/4532257 to your computer and use it in GitHub Desktop.
Copy files out of an MS Access database and load it into Postgres using mdb-tools
This file contains 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
mdb-schema current_lmrp.mdb postgres | psql lcd | |
mdb-tables -1 current_lmrp.mdb | xargs -Itable sh -c "mdb-export -H current_lmrp.mdb table > newcsv/table.csv" | |
ls newcsv | xargs -I{} sh -c "echo {} | cut -d'.' -f1" | xargs -I{} psql -c "COPY {} from '/Users/andrewg/Downloads/current_lmrp/newcsv/{}.csv' DELIMITER ',' CSV;" lcd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment