Update README.md

This commit is contained in:
michal-kapala 2023-03-06 02:26:31 +01:00
parent 2fd1142c8c
commit c92fd20fbc

View File

@ -22,6 +22,7 @@ PocketBase types are:
- `JSON` - `JSON`
# Configuration # Configuration
Install the latest [Deno runtime](https://deno.land/) to run the scripts.
In the root directory create `.env` file with the following environment In the root directory create `.env` file with the following environment
variables: variables:
@ -41,8 +42,8 @@ You can change the default import options to your needs:
| input | CSV/JSON | Yes | The name of the input file (with extension) | --input=example.csv | | input | CSV/JSON | Yes | The name of the input file (with extension) | --input=example.csv |
| id | CSV/JSON | No | Indicates that `_id` column should be typed as plain text, the type is detected by default | --id | | id | CSV/JSON | No | Indicates that `_id` column should be typed as plain text, the type is detected by default | --id |
| lf | CSV | No | LF (`\n`) EOL character will be used instead of default CLRF (`\r\n`) | --lf | | lf | CSV | No | LF (`\n`) EOL character will be used instead of default CLRF (`\r\n`) | --lf |
| delimiter | CSV | No | Column value separator, defaults to `,` | --delimiter=; | | delimiter | CSV | No | Column value separator, defaults to `,` | --delimiter=";" |
| quote | CSV | No | Value quote character, defaults to `'` | --quote=~ | | quote | CSV | No | Value quote character, defaults to `'` | --quote='~" |
# CSV # CSV
@ -63,5 +64,5 @@ deno run --allow-read --allow-env --allow-net csv.ts --input=example.csv --id
Import with custom parser options (you need to adjust `example.csv`): Import with custom parser options (you need to adjust `example.csv`):
``` ```
deno run csv.ts --input=example.csv --delimiter=; --query=~ --lf deno run csv.ts --input=example.csv --delimiter=";" --quote="~" --lf
``` ```