kevpl541991
kevpl541991

Reputation: 191

Is it possible to export a dataset as an ANSI text file from Foundry?

If I apply specific text formatting of header, body, and trailer to input data within Foundry via SQL, is there a way to export the output dataset as an ANSI text file?

Upvotes: 1

Views: 267

Answers (1)

Vasil V
Vasil V

Reputation: 11

You can use the TEXT output format in combination with concatenating your data to a single column and coalescing to a single partition. This output format doesn't support numeric types, so make sure to cast numeric columns as string:

CREATE TABLE `/path/to/your_output` USING TEXT AS 
    SELECT /*+ COALESCE(1) */ col1 || ' ' || cast (col2 as string) as result FROM `/path/to/your_input`

The resulting file should be available for download in the dataset details page:

file_download_example

Upvotes: 1

Related Questions