Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top
top

Info
Tool CSV to Catalog converter is a tool for conversion of a CSV (Comma-Separated Values) file into a Catalog in Catalog in EPISODES Platform format. The csv file should use ';' as delimiter, and should include header line with names of the columnsMatlab-based format.


CATEGORY Converters

KEYWORDS Format conversion

CITATION Please acknowledge use of this application in your work: 
IS-EPOS. (2019). Resource Management Applications [Web applications]. Retrieved from https://tcs.ah-epos.eu/

Requirements for input file
Anchor
Requirements
Requirements

The input file to be converted to the EPISODES Platform Matlab-based format should be a valid CSV file, with values separated by commas (',') - see also CSV format specifications, e.g., https://tools.ietf.org/html/rfc4180. The file has to include a header line with names of the columns in the catalog. The numbers within the file should use English locale, the text, if containing special characters (including comma, used for values separation) should be enclosed in double quotes.

Example input file

The excerpt below contains a sample content of a valid input CSV file. It defines 8 catalog columns with two entries. Each entry contains a value for each column, if the value is not specified, it should be left empty (note the double comma in the last line of Excerpt 1) The most popular column names and formats are described in this guide, however, custom columns are also allowed. The time should be written as a single text value with any format, however, this format has to be later specified within the application form (see TODO). 

Code Block
ID,Time,ML,Mw,Depth,RMS time residual,Hypocenter quality index,Comments
Id001,2014-01-01 

Step by Step

CSV to Catalog converter allow for conversion of a CSV file into a Catalog in EPISODES Platform format.

The csv file should use ';' as delimiter, and should include header line with names of the columns.

Headline example:         

ID;Time;ML;Mw;Depth;RMS_time_residual;Hypocenter_quality_index;Comments

Data example:                                  

Id001;2014-01-01
00:05:02.017
;
,3
;
,3.5
;
,0.4
;
,1.123
;
,2
;
,"mainshock
"
Id002
;
,2014-01-08 00:40:09.136
;
,,4
;4
.3
;
,0.5
;
,2.234
;
,1
;
,"aftershock

A particular attention should be paid while specifying the format of time.

The CSV file prepared in the way described above should be uploaded to the WORKSPACE of the EPISODES Platform.

 Image Removed

Figure 1. Input of CSV to Catalog converter application.

When using the application, in the Data Format column, we should follow the formats contained in the documentation https://tcs.ah-epos.eu/eprints/1675/31/Catalog_description_v2_0.pdf

Example:

The column named ID, is according to the documentation of a type 3. Therefore is requires data format of Text.

"

Excerpt 1. Sample content of a CSV input file. Note, the empty value (third in the last row) and text values surrounded with double quotes.

Input file specification

The application requires single file of type Catalog in CSV - see also previous section for the input file requirements.

Image Added

Figure 1. Application input file specification

Filling form values

The application form is generated based on the specific input file - the column names from header line are displayed in the first column (see Figure 2). By default all columns will be present in the result catalog, however, to exclude any of them uncheck the box near to the column name (as marked with (1) in Figure 2). To read the file content correctly, it is required to set the column content type (marked with (2) in Figure 2), so that the program knows how to interpret the subsequent values. If the content type is Date and time, it is also required to set the time format (marked with (3) in Figure 2) to allow correct reading of the time fields. It is also possible to specify a different name for the column in the resulting catalog (by default the name is the same as in the header) or add a description or unit. To set a specific column type (e.g. to specify that a column is a magnitude), use the Column type drop-down list. Additionally, a display format might be added to specify a custom mode of display (e.g. engineering notation), with a help of a wizard (accessible with icon marked with (4) in Figure 2 and options visible in Figure 3).

If the column name from the file header was defined among the standard catalog column names, all of the above properties will be already filled with defaults by the system (rows from ID to Depth in Figure 2). For other values, they have to be specified by the user. 

Image Added

Figure 2. Application form with most important elements marked.

Image Added

Figure 3. Wizard used for display format specification

It is advisable that the catalog is always sorted by time, therefore, the form also offers an option to sort the resulting catalog (marked with (5) in Figure 2).

Produced output

The resulting file will have the same name as the input, with only the extension changed to .mat.

 Image Removed

Figure 2. Catalog content and format specification

Image Removed

Image Removed

Back to top

Related Documents

Content by Label
showLabelsfalse
max10
spacesISDOC
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "converters" and type = "page" and space = "ISDOC"
labelskb-how-to-article