how to convert Access MDB file into an ASCII file ?


I have opensuse 11 installed. I would like to know if from this OS, there’s a way to export a Table from Microsoft Access MDB file, into CSV or ASCII text format? But I need it to run from the shell, because I would like to put this command into a script to run automatically.

For example, something like this:

mdbtools <filename.mdb> <table name> <output_filename.txt>

Trouble with access is that it uses microsoft’s own formatting and not that many average people use access compared to word or excel. This means that most linux or even non M$ Office windows programs will read access files.
The best way to get it converted is directly in windows from a running version of access.
Another way would be to use an odbc connection to the database file and use sql commands to export the tables. Trouble is, I don’t think you will find a linux odbc connector for access.

If the file is not too complicated, you could import the fields into an Excel file, save it, open it in OpenOffice and export as CSV.

(That would give you the Linux line endings rather than the Windows ones).

When you have mdbtools installed, you can use mdb-export to export a table from an mdb file to csv

mdb-export file.mdb tablename > file.csv

You can use Pentaho Data Integration (aka Kettle) for that.

You create a transformation in a GUI (called spoon). You can run the transformation from within the GUI or through the commandline using pan.

If you’re going to do “stuff” with that data you might want to check it out - it’s a very powerful open source suite of tools.