Data Resource - Csv

Data Resource - Csv

About

csv is a supported tabular file data resource.

Attributes

A csv file may get the following data attributes:

Name Default Value Description
comment-character # The character that if found as the first character of a line makes the line a comment
delimiter-character , The character that delimits every fields (ie columns)
escape-character null The character that when found before a CSV character, set it as a character and not as a property
header-row-id 1 The row id where the header is located (0 means no header and 1 the first line)
ignore-empty-line true Empty line are ignored
quote-character " The character that enclose a field value.

Because a csv file is also a text file, you can also set text attributes

Manifest

Example of attributes setting in a kind resource manifest

kind: csv
spec:
  data-def:
    logical-name: favorite_books
    header-row-id: 1
    delimiter-character: ','
    columns:
      - name: asin
        type: varchar
        precision: 20
      - name: description
        type: varchar
      - name: price
        type: double
      - name: group
        type: varchar


You can then use the manifest for any data operation on the csv file

tabul data print books--csv.yml@howto
books.csv@md
asin            description                                   price   group
-------------   -------------------------------------------   -----   ----------
B007US9NA8      The New Encyclopedia of Modern Bodybuilding   27.18   Sports
1439199191      How To Win Friends And Influence People       27.18   Psychology
9780465050659   The Design of Everyday Things                  9.99   Design
9780465050659   The Design of Everyday Things                  9.99   Psychology
B00555X8OA      Thinking, Fast and Slow                        8.85   Decision
B00555X8OA      Thinking, Fast and Slow                        8.85   Psychology




Related HowTo
Undraw Environment
How to create a CSV dynamically with a script?

This howto will show you how you can create any resource dynamically with a script. In this example, we will create a CSV but you can create any type of resource on the fly. You should have followed...
Undraw Environment
How to diff a SQL table ?

This howto show you how to perform diff operation between 2 SQL Tables with the data diff command. In this step, we load the csv resources that we want to compare into sqlite Load the original...
Undraw Environment
How to generate data with a data set?

This howto will show you how to generate data with an data set generator. In these examples, we use a predefined csv entity file but you could any data resource such as : a sql table a sql query...
Undraw Environment
How to send data resources

This howto shows you how to send an email with a data resource attached via the sendmail operation. In the below pipeline, we use the following steps: select to select data resources that will be...
Undraw Environment
How to send to a mailing list

This howto shows you how to send multiple email with the sendmail operation. Start the howto smtp server Check that you can ping it In this pipeline, we define a inline data resource but you...
Undraw Environment
Learning Tabulify - Step 10 - Data Diff, a step by step

Data Diff is the cornerstone of every development because it validates the processing of data. Tabulify ships with a Data diff operation that allows you to compare: the data content and the data...
Undraw Environment
Learning Tabulify - Step 7 - How to execute a SQL Query

For Tabulify, a SQL Query is a runtime resource that when executed returns a data set in tabular format (known as the result set). The selector of a runtime is known as a runtime selector. This selector...
Undraw Environment
Learning Tabulify - Step 8 - How to modify the content of a table

Tabulify learning guidetransfer step The transfer page should have made you familiar with the transfer concept where we have introduced the copy operation. The copy and move operation does not modify...
Undraw Environment
Tabul - How to load a CSV file into a SQL table

How to upload a CSV file into a SQL table in two steps
Undraw Environment
Tabul - How to load a CSV file into a SQL table

How to upload a CSV file into a SQL table in two steps

Task Runner