convert: command: convertFile input-file: data/insee/a00.csv output-file: tmp/insee/a00/a00-ymd.csv actions: - ymd2iso anais00 mnais00 jnais00 -> C - ymd2iso ANAISM MNAISM JNAISM -> M - ymd2iso ANAISP MNAISP JNAISP -> F - ymd2iso AMAR MMAR JMAR -> W - copy rangmar00 -> WRANK
input-file
Absolute or relative path to the csv file to transform.Relative paths are relative to the root directory of
observe
, containing run-observe.php
and config.yml
.
output-file
Absolute or relative path to the generated csv file.Relative paths are relative to the root directory of
observe
, containing run-observe.php
and config.yml
.
actions
Describe the transformations done to convert the file.The program executes all the actions on each line of the input file to generate one line of the output file.
The syntax is :
<action to execute> <input column(s)> -> <generated column>For example :
ymd2iso anais00 mnais00 jnais00 -> Cmeans : "execute action
ymd2iso
, using input columns anais00
, mnais00
, jnais00
, and generate column C
in the output file".
For csv files without header (a first line containing the names of the columns), column indexes (starting with 0) are used.
- ymdhms2iso 13 12 11 14 15 16 -> F_DATE
The actions are methods of class
observe\commands\convertFile
Supported actions are :
ymd2iso
Takes 3 column names in input (containing year, month, day) to generate a column containing aYYYY-MM-DD
date.
ymdhms2iso
Takes 6 column names in input (containing year, month, day, hour, minute, seconds) to generate a column containing aYYYY-MM-DD HH:MM:SS
date and time.