Skip to main content
Version: current

Export to CSV

Description

In SAFE you can export datasets to csv files, to make it convenient to process data further in e.g. Excel.

MxN

The format of the .csv file is as follows for an MxN data size. Each cell i seperated by ,. The header consists of the sample rate fs the xlabel, the ylabel and the tag and unit for each channel. Each tag for x and y channels match, and the units for x and y also match respectively. After the header the data is found. All the x data first, followed by the y data.

fs=int......
xlabel=str......
ylabel=str......
tag_0 [x_unit]...tag_N [x_unit]tag_0 [y_unit]...tag_N [y_unit]
x_data_0_0...x_data_0_Ny_data_0_0...y_data_0_N
..................
x_data_M_0...x_data_M_Ny_data_M_0...`y_data_M_N

Input

The input is MxN and is a dataset.

Attributes

AttributeValue
NameExportToCsv
File Name ExportToCsv
Path' '
OverwriteTrue
Inputs1

Name

Name specifies the name of the block.

File Name

File name specifies the name of the csv file that SAFE should export to or create if it does not exists.

Path

Path specifies the path where the exported .csv file should be placed.

Overwrite

Overwrite specifies if True when an export happens, the new export should overwrite an existing file with the same name, or if False creates a new file with the same name + (1).

Inputs

Inputs specifies the number of inputs(s) the block will have. Currently there can only be a single input.

Examples

A single dataset export.

fs=48000,
xlabel=Time,
ylabel=Amplitude,
Measurement 1 [s],Measurement 1 [Pa]
1,11
2,12
3,15
4,17
5,20

A multicolumn dataset export.

fs=48000,,,
xlabel=Time,,,
ylabel=Amplitude,,,
Measurement 1 [s],Measurement 2 [s],Measurement 1 [Pa],Measurement 2 [Pa]
1,1,11,66
2,2,12,114
3,3,15,150
4,4,17,19
5,5,20,10

Literature