# Export data

# Export data

Save recorded channels to a folder you can open in Excel, a notebook, DIAdem or
LabVIEW. One sheet does it, from wherever you are looking at data.

## Open the sheet

| From | Control |
|---|---|
| Replay | **Download** at the top right |
| A run in Replay's **runs** tab | **Download…** in its menu |
| Live, after a run stops | **Download** on the *Run saved* note (when files are not saved automatically) |
| A camera tile in Replay | **Download this camera as shown** |

The sheet, **Download data**, opens filled in from the screen: the window or run
you were on, and the channels you were showing. In the console, a run's page
has its own **Download data**.

## Four steps

| Step | Question | Choices |
|---|---|---|
| **When** | **Which stretch of time?** | a run, or a time range: **last 5 min**, **last 15 min**, **last hour**, **a run…**, **exact times…** |
| **What** | **What goes in it?** | **On screen**, **Everything** or **Choose** |
| **How** | **How should it come out?** | the format, below |
| **Review** | **You'll get one folder** | the folder's files, before anything is written |

Click any step, or any line of the review, to change it. Press **Download** to
write the folder; **Show in folder** opens it.

While choosing channels, each row shows a coverage bar: on the cloud and this
device, on this device only, on the cloud only, or nothing recorded. Gaps show
as *lost* or *not running*. **What the bars mean** shows the key.

## Pick a format by where it goes next

| **Save as** | Writes | Open in |
|---|---|---|
| **Spreadsheet** | CSV | Excel |
| **Notebook** | Parquet, one file, a row per sample | pandas, DuckDB |
| **DIAdem / LabVIEW** | TDMS, one file | DIAdem, LabVIEW, FlexLogger |

**Details** opens the settings. For **Spreadsheet**, **Table** picks the shape:

| **Table** | File |
|---|---|
| **a file per rate** | time down the side, a column per channel, one file per sample rate |
| **one wide file** | every channel in one file; an empty cell means that channel did not sample then |
| **a row per sample** | one file of time, channel, value |

**Rate** thins the data to a lower rate (default **Every sample**). **CSV** sets
the column separator, the decimal separator and the number of decimals.

## Cameras

| **Cameras** | Writes |
|---|---|
| **As you see it** | MP4 with the readings drawn on, frame by frame |
| **Clean footage** | MP4 without the readings |

If this device cannot write video, the sheet says which cameras it will skip.

## What's in the folder

| Item | Holds |
|---|---|
| `README.txt` | what the folder holds, in plain words |
| `channels.csv` | each channel: its file, column, unit and rate |
| `data/` | the data files |
| `details/` | files for tools and audit: coverage, gaps and the run's events |

Every data CSV opens with `t_us` (exact time, microseconds) and `t_s` (seconds
from the start of the window). A CSV stops at 1,048,575 rows, one Excel sheet,
and continues in `_part2.csv`, `_part3.csv` and so on. Each part repeats the
header. The sheet warns you before it splits.

> **Note:** MCAP is not in the sheet. Use the command line:
> `phloem export '/rig/**' --run <run id> --dest ~/exports --signals mcap`.

- [Open a run in Excel or pandas](https://phloem.ai/docs/guides/open-in-excel/): Step by step
- [Runs](https://phloem.ai/docs/review/runs/): Record and find runs
- [Replay](https://phloem.ai/docs/review/replay/): Choose the window first
