Skip to content

Exporting Data#

Concourse supports exporting data to CSV and Excel formats through the export tools.

Export CLI#

The concourse export command exports data from Concourse to a file or standard output.

CSV Export#

1
concourse export --format csv --output data.csv

Excel Export#

1
concourse export --format excel --output data.xlsx

Programmatic Export#

The concourse-export library provides an API for exporting data programmatically.

CSV Export#

1
2
3
4
5
// Java
Exporters.csv()
    .data(concourse.select("department = Engineering"))
    .to("/path/to/output.csv")
    .export();

Excel Export#

1
2
3
4
5
// Java
Exporters.excel()
    .data(concourse.select("department = Engineering"))
    .to("/path/to/output.xlsx")
    .export();

Multi-Valued Fields#

When a key has multiple values in a record, the exporter serializes them as a delimited list within a single cell. This preserves the multi-valued nature of Concourse fields in flat-file formats.

JSON Export#

For JSON output, use the jsonify method directly:

1
2
3
// Java
String json = concourse.jsonify(
    Lists.newArrayList(1L, 2L, 3L), true);
1
2
// CaSH
jsonify [1, 2, 3]

The true parameter includes record IDs in the output. See Reading Data for details.