# csv

Convert CSV files with custom column allocations

### Command line usage

```
/*^babelfsh
csv
   [--help] [--path PATH] [--url URL] [--delimiter DELIMITER]
   [--csv-quote CSV_QUOTE] [--csv-escape CSV_ESCAPE] [--skip-empty-lines]
   [--charset CHARSET] [--line-ending LINE_ENDING] [--headers HEADERS]
   [--concept-filter CONCEPT_FILTER] --code-column CODE_COLUMN
   --display-column DISPLAY_COLUMN [--definition-column DEFINITION_COLUMN]
   [--allow-missing-code-column] [--property-mapping PROPERTY_MAPPING]
   [--no-filter-duplicates]
   [--split-code-and-display-using SPLIT_CODE_AND_DISPLAY_USING]
^babelfsh*/
```

### Command line argument reference

|                                                         Argument name                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| :--------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      <p><code>--code-column CODE\_COLUMN</code></p><p><code>--cc CODE\_COLUMN</code></p><p><strong>Required</strong></p>     | Name of the column containing the codes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><code>--display-column DISPLAY\_COLUMN</code></p><p><code>--dc DISPLAY\_COLUMN</code></p><p><strong>Required</strong></p> | Name of the column containing the display names                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|                                                 `--allow-missing-code-column`                                                | Allow missing code column in CSV file (these rows are filtered out, useful for mapping source files that mainly define a ConceptMap). This is opt-in, i.e. default=false                                                                                                                                                                                                                                                                                                                                                                                                                        |
|                              <p><code>--charset CHARSET</code></p><p><code>-c CHARSET</code></p>                             | The charset of the file, with the name from java.nio.charset.Charset: Big5, Big5-HKSCS, CESU-8, EUC-JP, EUC-KR, ... See <https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html>                                                                                                                                                                                                                                                                                                                                                                                         |
|                 <p><code>--concept-filter CONCEPT\_FILTER</code></p><p><code>--cf CONCEPT\_FILTER</code></p>                 | Filter concepts based on the values in the CSV file. Supported operators with supported case-insensitive keywords in parentheses: EQUALS ('=', '==', 'equals'), NOT\_EQUALS ('!=', '<>', 'not-equals', 'not\_equals'), NOT\_BLANK ('not-blank', 'not\_blank'), BLANK ('blank')                                                                                                                                                                                                                                                                                                                  |
|                                                   `--csv-escape CSV_ESCAPE`                                                  | Escape character used in the CSV file. Default is double quote (")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                                                    `--csv-quote CSV_QUOTE`                                                   | Quote character used in the CSV file. Default is double quote (")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|                                            `--definition-column DEFINITION_COLUMN`                                           | Name of the column containing the definitions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                           <p><code>--delimiter DELIMITER</code></p><p><code>-d DELIMITER</code></p>                          | Delimiter used in the CSV file. Default is comma (,)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|                             <p><code>--headers HEADERS</code></p><p><code>--hd HEADERS</code></p>                            | List of headers to use, provided as a JSON list. If not provided, headers will be read from the file. Example: \["header1", "header2"]                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|                                       <p><code>--help</code></p><p><code>-h</code></p>                                       | show this help message and exit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|                      <p><code>--line-ending LINE\_ENDING</code></p><p><code>--le LINE\_ENDING</code></p>                     | Line ending used in the CSV file, default                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|                       <p><code>--no-filter-duplicates</code></p><p><code>--filter-duplicates</code></p>                      | Filter duplicate concepts based on code and display name. If collisions occur, this will result in an error. Default false (all duplicates are treated as errors).                                                                                                                                                                                                                                                                                                                                                                                                                              |
|     <p><code>--path PATH</code></p><p><code>--file PATH</code></p><p><code>-p PATH</code></p><p><code>-f PATH</code></p>     | Path to the CSV file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|              <p><code>--property-mapping PROPERTY\_MAPPING</code></p><p><code>--pm PROPERTY\_MAPPING</code></p>              | Mapping of additional properties to columns in the CSV file. The property mapping is a JSON array of objects, where each object has the following properties: \<column>: the name of the column in the CSV file; \<code>: the code of the property in the FHIR CodeSystem; \<required>: whether the property is required (true or false, default false); \<mapper>: a mapper specification (see below)Example: {"column": "my\_column", "required": true, "property": "my\_property", "mapper": {"id": "boolean", "arguments": {"1": "true", "0": "false"}}}Supported property mappers: boolean |
|                                 <p><code>--skip-empty-lines</code></p><p><code>-s</code></p>                                 | Skip empty lines in the CSV file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|                                 `--split-code-and-display-using SPLIT_CODE_AND_DISPLAY_USING`                                | If specified, split code and display columns using this separator. Default is not to split.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                                    <p><code>--url URL</code></p><p><code>-u URL</code></p>                                   | URL to the CSV file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://su-termserv.gitbook.io/babelfsh/plugin-docs/codesystem/csv.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
