# CSV Format

> Working with CSV data in Orbital

Source: https://orbitalhq.com/docs/data-formats/csv

To declare that a type should be read/written as Csv, add the `com.orbitalhq.formats.Csv` annotation to a model:

```taxi
import com.orbitalhq.formats.Csv

@Csv
model Person {
  firstName : FirstName inherits String
}
```

## Csv options

The following options are available:

| Parameter name             | Description                                                        | Default value |
|----------------------------|--------------------------------------------------------------------|---------------|
| delimiter                  | The delimiter between records                                      | `,`           |
| firstRecordAsHeader        | Indicates if the first record should be read as a header           | true          |
| nullValue                  | Specify a custom string to be read as `null`                       |               |
| containsTrailingDelimiters | Indicates if each row contains a delimiter which should be ignored | false         |
| quoteChar                  | Specifies which character should be read as a quoting character    | `"`           |

For example:

```taxi
import com.orbitalhq.formats.Csv

@Csv(
  delimiter = "|",
  nullValue = "NULL"
)
model Person {
  firstName : String
  lastName : String
  age : Int
}
```

## Using column() references

**Warning: Deprecated**
Using the `by column` tag is deprecated. 
  
  Field names in the model are now used to match columns
 

It's possible (but discouraged) to use `by column("")` references to declare a column:

```taxi
model Person {
  firstName : FirstName by column("fName")
}
```
