No commit activity in last 3 years
No release in over 3 years
Parses csv files with schema file read by other file input plugins.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.0
>= 10.0
 Project Readme

CSV Parser with schema config file plugin for Embulk

Parses csv files with schema file read by other file input plugins.

Overview

  • Plugin type: parser
  • Guess supported: no

Usage

Install plugin

$ embulk gem install embulk-parser-csv_with_schema_file

Configuration

Example

in:
  type: file
  path_prefix: /tmp/csv/
  parser:
    type: csv_with_schema_file
    schema_path: /tmp/csv_schema.json
    default_timestamp_format: '%Y-%m-%d %H:%M:%S %z'
out: 
  type: stdout

Schema file example (csv_schema.json)

[
   {
      "index": 0,
      "name": "Name",
      "type": "string"
   },
   {
      "index": 1,
      "name": "Cnt",
      "type": "long"
   },
   {
      "index": 2,
      "name": "RegDate",
      "type": "timestamp"
   }
]

Custom column option example

in:
  type: file
  path_prefix: /tmp/csv/
  parser:
    type: csv_with_schema_file
    default_timestamp_format: '%Y-%m-%d %H:%M:%S'
    schema_path: /tmp/csv_schema.json
    columns:
      - {name: Date2, type: timestamp, format: '%Y-%m-%d %H:%M:%S.%N %z'}
out: 
  type: stdout
  

Build

$ ./gradlew gem  # -t to watch change of files and rebuild continuously