# CsvOptions

The options for imported source files in CSV format.

- Source: [`aws-dynamodb/lib/table.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts#L102)
- Type last changed: v2.123.0 · 24 Jan 2024

## Example

```ts
import * as cdk from 'aws-cdk-lib';
import * as s3 from 'aws-cdk-lib/aws-s3';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack');

declare const bucket: s3.IBucket;

new dynamodb.Table(stack, 'Table', {
  partitionKey: {
    name: 'id',
    type: dynamodb.AttributeType.STRING,
  },
  importSource: {
    compressionType: dynamodb.InputCompressionType.GZIP,
    inputFormat: dynamodb.InputFormat.csv({
      delimiter: ',',
      headerList: ['id', 'name'],
    }),
    bucket,
    keyPrefix: 'prefix',
  },
});
```

## Properties

- `delimiter`: string — The delimiter used for separating items in the CSV file being imported.

  **Default:** use comma as a delimiter.

  Valid delimiters are as follows:
  - comma (`,`)
  - tab (`\t`)
  - colon (`:`)
  - semicolon (`;`)
  - pipe (`|`)
  - space (` `)

- `headerList`: string[] — List of the headers used to specify a common header for all source CSV files being imported.

  **Default:** the first line of the CSV file is treated as the header

  **NOTE**: If this field is specified then the first line of each CSV file is treated as data instead of the header.
  If this field is not specified the first line of each CSV file is treated as the header.
