Skip to content

Commit

Permalink
Example for escaping of column headers in CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
ktk committed Feb 12, 2021
1 parent bfd9a7a commit 5a4103c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions documentation/mapping-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ logical-source airport {

A `logical-source` can stand on its own or be contained in a `source-group`

#### Escaping special chars

In CSV we often find weird column headers with whitespace and/or special chars. XRM will show you errors on those lines so you will need to escape them. You can escape them by adding quotes around the string. To be able to reference it properly, you need to give a valid alias that will be used instead.

```
logical-source airport {
type csv
source "http://www.example.com/Airport.csv"
referenceables
id
stop
latitude
longitude
specRow "Spec. Row"
}
```

In this example the column name `Spec. Row` from the CSV is escaped and will be referenced using `specRow` instead.


#### SQL query as source

Expand Down

0 comments on commit 5a4103c

Please sign in to comment.