By loading a table in one format and saving it to another it is possible to use TOPCAT to convert tabular data between supported input and output formats.
However, if this is all that you want to do, there is a a more convenient way of doing it from the command line. This avoids the overhead of starting up the GUI, prevents you having to point and click, and may also make more efficient use of memory.
Tables can be copied between formats using the 'tablecopy'
command. If you have the full Unix installation this can be invoked
using the bin/tablecopy shell script.
Alternatively, it can be invoked from the jar file by doing
java -classpath topcat.jar uk.ac.starlink.table.TableCopy [args](the
topcat-full.jar, topcat-lite.jar
or tablecopy.jar jarfiles
can be used instead if those are what you have).
All the commments about classpaths and arguments to Java itself
described in the section on
Invoking TOPCAT
apply here as well.
The command is straightforward to use. Typing
tablecopy -help
(or
java -classpath topcat.jar uk.ac.starlink.table.TableCopy -help)
produces the following usage message:
Usage: TableCopy [-disk] [-debug] [-h[elp]] [-v[erbose]]
[-ifmt <in-format>] [-ofmt <out-format>]
<in-table> <out-table>
Auto-detected in-formats:
fits-plus
fits
votable
Known in-formats:
fits-plus
fits
votable
ascii
csv
wdc
Known out-formats:
jdbc
fits
fits-plus
fits-basic
votable-tabledata
votable-binary-inline
votable-fits-href
votable-binary-href
votable-fits-inline
text
ascii
csv
html
html-element
latex
latex-document
mirage
The flags and arguments have the following meaning:
Here are some examples of use:
tablecopy stars.fits stars.xml
tablecopy -ifmt csv -ofmt votable-binary stars.csv stars.vot
tablecopy -ofmt text vizier.xml#4 -
java -Djdbc.drivers=com.mysql.jdbc.Driver
-classpath topcat.jar:mysql-connector-java-3.0.6-stable-bin.jar
uk.ac.starlink.table.TableCopy
-ofmt fits
"jdbc:mysql://localhost/astro1#SELECT ra, dec, Imag, Kmag FROM dqc"
wfslist.cat