EDI Converter CLI Options
Usage
ediconvert [-hqrV] [--format-json] [--[no-]out-control-segments]
[--out-segments] [--single-csv] [--[no-]split-tran]
[--[no-]transaction-top-level] [--[no-]validate]
[--chunk-size=<chunkSize>] [--csv-config=<csvConversionSchemaFileName>]
[--csv-schema-name=<csvConversionSchemaName>] [-m=<outputFormat>]
[-o=outputFileOrDirectory] [-p=<filePatterns>]
[--progress-chunk-size=<loggingChunkSize>]
[--tran-type=<transactionTypeFilter>] ediFilesOrDirectories...
Converts X12 EDI files to JSON, newline-delimited JSON (JSONL/NDJSON), or CSV/Excel.
General Options
| Option | Description |
|---|---|
ediFilesOrDirectories... |
X12 EDI files or directories containing X12 EDI files. You can supply multiple space-separated files or directories. You can also use the * and ? wildcards to convert all matching files. For a directory, all files in that directory will be converted. |
-p--patterns=<filePatterns> |
Filename patterns to match in the root directory, for example *837P.edi. You can specify multiple comma-separated patterns, for example *837*.edi, *837*.txt. Defaults to * (all files) if ediFilesOrDirectories is a directory. Enclose patterns in single quotes on Windows or double quotes on Linux. Patterns match only filenames, not directory names. |
-r--recurse |
Recursively search for matching files in all subdirectories. |
-o--out=outputFileOrDirectory |
Output file or directory in which to save the converted files. An output file will be created if it does not exist, and all input files will be converted into it. An output directory must already exist or its path must end with a slash. Each output file will use the EDI filename with an extension based on the output format. If omitted, the converter writes to the console (standard output), which can be piped to another program. |
-m--mode=<outputFormat> |
Output format. Acceptable values: CSV, EXCEL, JSON, JSONL. Defaults to JSON. |
--[no-]validate |
Validate EDI files. Validation messages are logged. For JSON or JSONL output, validation messages are written to the output file as VALIDATION objects. See EDI validation for details. Defaults to false or the value of the EDI_VALIDATE environment variable. |
--chunk-size=<chunkSize> |
Number of items to parse and convert at once. Items are EDI transactions or, for 837, 835, and 834 transactions, claims, payments, or members. This option determines the memory footprint and can be used for fine-tuning. Defaults to 50. Higher values improve performance but consume more memory. |
--[no-]split-tran |
Do not parse the entire transaction at once. Instead, parse individual claims from 837 transactions (CLM segments), payments from 835 transactions (CLP segments), or members from 834 transactions (INS segments). This is the default for 835, 837, and 834 transactions and is ignored for all other transaction types. Defaults to true. |
--progress-chunk-size=<loggingChunkSize> |
How often to log progress. By default, conversion progress is logged every 1,000 items (claims, members, or transactions). You can change the default by setting the EDI_LOG_CHUNK_SIZE environment variable. |
-q--quiet--suppress-progress |
Suppress logging of filenames and conversion progress to the console. Use this option when writing converted data to standard output. |
-h--help |
Show help and exit. |
-V--version |
Print version information and exit. |
JSON/JSONL-specific Options
| Option | Description |
|---|---|
--format-json |
Format JSON with indentation and newlines. Ignored for JSONL. |
--[no-]transaction-top-level |
Write EDI transactions at the top level of the response as TRANSACTION objects. If not set, the EDI transaction is repeated in each claim, payment, or member object. Setting this option reduces the size of the response. Defaults to false or the value of the EDI_TRANSACTION_TOP_LEVEL environment variable. |
--[no-]out-control-segments |
Write control segments (ISA and GS) to the output file as JSON objects. Defaults to false or the value of the EDI_CONVERT_CONTROL_SEGMENTS environment variable. |
--out-segments |
Convert to the X12 EDI loop and segment tree format rather than a list of claims, payments, and other objects. Converting to this format can be slow for large transactions. |
CSV-specific Options
| Option | Description |
|---|---|
--csv-schema-name=<csvConversionSchemaName> |
Name of the schema (configuration) in the CSV config file, for example key-fields. The schema determines the layout of the CSV file. See CSV schemas for the list of schemas. |
--csv-config--csv-schema-file=<csvConversionSchemaFileName> |
Name of the file containing CSV conversion schemas in the conf directory. Defaults to conf/csv_conversion.yaml. |
--tran-type=<transactionTypeFilter> |
Convert only files containing transactions of this type. All other files will be ignored. Acceptable values: 835, 837P, 837I, 837D, 834. |
--single-csv |
Convert all EDI files into a single CSV file containing claim-level and service-line-level fields for 837 and 835 transactions. If not provided, the converter writes claim-level and service-line-level data to separate files. Equivalent to specifying --csv-schema-name=single-file. A single file is the default for 834. |
Logging
The converter creates logs with information and diagnostic messages in the logs directory. These logs are useful when writing output to standard output.
The converter always logs to the file, even when the --quiet option is set.
The default location of the logs folder is the directory where the converter is executed. It can be changed by defining the ediconvert_logs_dir environment variable, e.g.:
export ediconvert_logs_dir=ediconverter_logs