0

I have a .gdb Firebird database file that I would like to partially transform to .csv. From the CLI tool, I'm able to do the following:

CONNECT "/Users/jpmonette/Desktop/file.gdb"; OUTPUT /Users/jpmonette/Desktop/output.csv; SELECT EMAIL,FIRSTNAME FROM ACCOUNT;

This seems to be working as expected - outputting stdout to a file. However, I would like to know if there is a way to output the data in a easy to consume format (JSON? CSV? SQL dump?). I had a look at fbexport and fbcopy, but they both seem to be not available for OSX.

Any clue on how I could get around that?

1 Answer 1

1

You can concatenate output to CSV, like select email || ',' || firstname from account with column header turned off using set heading

2
  • It doesn't seem to behave well with line breaks, encoding and escaping the commas. Any other way that I could dump this data in a consumable format?
    – jpmonette
    Commented Jan 26, 2016 at 16:27
  • @jpmonette As far as I know there is no common agreed format for linebreaks in CSV. You might want to search for a tool that supports JDBC and exports to CSV. Commented Jan 28, 2016 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.