Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mdb-export not creating CSV file

When I run mdb-export, the program dumps the comma delimited table to the terminal, but does not create a csv file as far as I can tell.

Is mdb-export creating a csv file somewhere or is this dump its intended function? If the latter is the case, how would one go about getting the output into a csv file?

like image 939
makewavesnotwar Avatar asked Aug 22 '13 01:08

makewavesnotwar


2 Answers

You first need to install mdb-tools (Ubuntu, Debian):

sudo apt install mdbtools

Then to list the tables do this:

mdb-tables database.mbd 

then with the desired table

mdb-export database.mdb table > table.csv

To export all the tables try this command:

mdb-tables -1 database.mdb | xargs -I{} bash -c 'mdb-export database.mdb "$1" >"$1".csv' -- {}
like image 153
Eduard Florinescu Avatar answered Sep 19 '22 15:09

Eduard Florinescu


Alright, I ended up figuring it out. I was originally following the tutorial here and was running:

mdb-export database.mbd TABLE_NAME, but what I needed was

mdb-export database.mdb TABLE_NAME > output_file.csv

like image 22
makewavesnotwar Avatar answered Sep 19 '22 15:09

makewavesnotwar