Skip to content

Commit

Permalink
Reorganized sections
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmartinelli committed Aug 18, 2015
1 parent ec74da8 commit 54c6d9a
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,6 @@ SELECT name as person, regexp_split_to_table(friends, E'\\,') as friend
FROM import.friends
```

### Dealing with different CSV formats

Quite often you want to specify a custom delimiter (default: `,`).

```bash
pgfutter csv -d "\t" traffic_violations.csv
```

You have to use `"` as a quoting character and `\` as escape character.
You might omit the quoting character if it is not necessary.

### Custom header fields

If you want to specify the field names explicitly you can
skip the header row and pass a comma separated field name list.

```bash
pgfutter csv --skip-header --fields "name,state,year" traffic_violations.csv
```

## Import JSON

A lot of event logs contain JSON objects nowadays (e.g. [GitHub Archive](https://www.githubarchive.org/)).
Expand Down Expand Up @@ -167,7 +147,27 @@ name | default | description
`DB_USER` | `postgres` | database user
`DB_PASS` | | password (or empty if none)

## Advances Use Cases
## Advanced Use Cases

### Custom delimiter

Quite often you want to specify a custom delimiter (default: `,`).

```bash
pgfutter csv -d "\t" traffic_violations.csv
```

You have to use `"` as a quoting character and `\` as escape character.
You might omit the quoting character if it is not necessary.

### Custom header fields

If you want to specify the field names explicitly you can
skip the header row and pass a comma separated field name list.

```bash
pgfutter csv --skip-header --fields "name,state,year" traffic_violations.csv
```

### Encoding

Expand Down

0 comments on commit 54c6d9a

Please sign in to comment.