Usercube-Export-Csv
Examples
Exporting a file respecting the default parameters
Consider the file C:/identitymanagerContoso/Sources/hr_example.csv
with ,
as separator and UTF8
encoding, it can be exported with the command:
--raw-files-path C:/identitymanagerContoso/Sources/hr_example.csv --ignore-cookies --connection-identifier HREXAMPLE --output-path C:/identitymanagerContoso/Temp/ExportOutput
The output file will be located in C:/identitymanagerContoso/Temp/ExportOutput/HREXAMPLE.csv
and the
content will be a copy of hr_example.csv
's one and an UTF8
encoding.
Define a separator
Consider the file C:/identitymanagerContoso/Sources/hr_example.csv
with ;
as separator.
As ,
is considered to be the default separator, we must set it:
--raw-files-path C:/identitymanagerContoso/Sources/hr_example.csv --ignore-cookies --connection-identifier HREXAMPLE --output-path C:/identitymanagerContoso/Temp/ExportOutput --separator ;
The result's content will be the same but with ,
as separator.
Use a regex file name
Consider that you deal with a generated file that follows the regex:
C:/identitymanagerContoso/Sources/hr_example(.*?).csv
, for example
C:/identitymanagerContoso/Sources/hr_example5fH8g1.csv
. If several files match with the regex, the
executable uses the last one that was generated.
You can put your regex and precise that it is one with the --regex
argument:
--raw-files-path C:/identitymanagerContoso/Sources/hr_example(.*?).csv --ignore-cookies --connection-identifier HREXAMPLE --output-path C:/identitymanagerContoso/Temp/ExportOutput --regex
Use the Path Duality and the Not-Launch-Export System
In a larger context, the export might be used for complete or incremental synchronization. That is
why it has two paths: --raw-files-path
for complete synchronizations, --path-incremental
for
incremental ones.
In the export's scope, it only means one thing, what path must be used depends on
--ignore-cookies
: its presence meaning that we are in a complete synchronization context and we
use --raw-files-path
; its absence that we are in an incremental one and we use
--path-incremental
.
It means that if the user gives --ignore-cookies
and not --raw-files-path
, or if they give
neither --ignore-cookies
nor --path-incremental
, the export will not be launched to prevent any
problem (complete data for an incremental synchronization for example). The --force-complete
argument bypasses this security: in the product, it is used for the initialization job, where we
want to perform a complete synchronization, even for CSV connections with only an incremental path.
Arguments
Argument Name | Details |
---|---|
--connection-identifier optional | Type String Description Connector's connection identifier. The output file will have this identifier as name. |
--output-path required | Type String Description Output path for the files generated by the export. |
--- | --- |
--ignore-cookies optional | Type No Value Description Specifies the synchronization mode, its presence meaning complete, its absence incremental. |
--- | --- |
--regex optional | Type No Value Description The file name is a regex so we find the last generated corresponding file. |
--separator optional | Type String Description Defines the separator if different than , . |