# Best way to export YCQL data

**URL:** <https://forum.yugabyte.com/t/best-way-to-export-ycql-data/445>\
**Category:** General\
**Created:** [July 23, 2019, 11:08am UTC](https://forum.yugabyte.com/t/best-way-to-export-ycql-data/445 "2019-07-23T11:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.afloat](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@adam.afloat](https://forum.yugabyte.com/u/adam.afloat)\
**Post date:** [July 23, 2019, 11:08am UTC](https://forum.yugabyte.com/t/best-way-to-export-ycql-data/445/1 "2019-07-23T11:08:24Z")

</div>

**What is the recommended tool/procedure to export data from a YCQL table into say, CSV format?**

---

<div class="post-metadata">

**Author:** ![bryn](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/bryn/32/104_2.png) [@bryn](https://forum.yugabyte.com/u/bryn)\
**Post date:** [July 23, 2019, 9:11pm UTC](https://forum.yugabyte.com/t/best-way-to-export-ycql-data/445/2 "2019-07-23T21:11:23Z")

</div>

Sorry! I read “YSQL” when I saw your “YCQL”. You might be interested in an answer to a question that you didn’t ask.

Easy [for YSQL]: use the `\copy` meta-command at the `ysqlsh` prompt. Look:

```auto
drop table if exists t;
create table t (
  id integer generated always as identity primary key,
  c1 text);
insert into t(c1) values
  ('dog'),
  ('cat'),
  ('mouse'),
  ('Norwegian Blue');
\copy t to 't.txt' (format 'csv')

```

Here’s the `t.txt` that I got:

```auto
1,dog
4,Norwegian Blue
2,cat
3,mouse

```

And here’s the grammar:

```auto
\copy { table [( column_list )] | ( query ) } { from | to } { 'filename' | program 'command' | stdin | stdout | pstdin | pstdout } [[ with] ( option [, ...] ) ]

```

Regards, [bryn@yugabyte.com](mailto:bryn@yugabyte.com)

---

<div class="post-metadata">

**Author:** ![karthik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/karthik/32/13_2.png) [@karthik](https://forum.yugabyte.com/u/karthik)\
**Post date:** [July 23, 2019, 9:28pm UTC](https://forum.yugabyte.com/t/best-way-to-export-ycql-data/445/3 "2019-07-23T21:28:28Z")

</div>

Hi @adam.afloat,

For YCQL this doc page should help (see the last section on data export):

> **[Bulk export YSQL](https://docs.yugabyte.com/preview/manage/data-migration/bulk-export-ysql/)**
>
> Bulk export for YSQL using ysql\_dump.

Also, here is the github page which also has a lot of information:

> **[GitHub - yugabyte/cassandra-loader: Delimited file loader for YugaByte Cloud...](https://github.com/YugaByte/cassandra-loader)**
>
> Delimited file loader for YugaByte Cloud Query Language (YCQL) - GitHub - yugabyte/cassandra-loader: Delimited file loader for YugaByte Cloud Query Language (YCQL)
