Skip to content

Instantly share code, notes, and snippets.

@hiroyuki-sato
Last active October 2, 2015 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiroyuki-sato/a1f6f718cee236645649 to your computer and use it in GitHub Desktop.
Save hiroyuki-sato/a1f6f718cee236645649 to your computer and use it in GitHub Desktop.
embulk filter eval sample
id account time purchase comment
1 32864 2015-01-27 19:23:49 20150127 embulk aaa
2 14824 2015-01-27 19:01:23 20150127 embulk jruby
3 27559 2015-01-28 02:20:02 20150128 Embulk "csv" parser plugin
4 11270 2015-01-29 11:54:36 20150129 NULL
in:
type: file
path_prefix: /private/tmp/newline_test/csv/sample_
parser:
charset: UTF-8
newline: CRLF
type: csv
delimiter: ','
quote: '"'
trim_if_not_quoted: false
skip_header_lines: 1
allow_extra_columns: false
allow_optional_columns: false
columns:
- {name: id, type: long}
- {name: account, type: long}
- {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
- {name: purchase, type: timestamp, format: '%Y%m%d'}
- {name: comment, type: string}
filters:
- type: eval
eval_columns:
- comment: value.gsub(/\t/," <TAB> ")
out: {type: stdout}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment