Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tilo committed Jul 7, 2024
1 parent bca84c9 commit 1c96425
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ Or install it yourself as:

# API

There is a simplified call for reading and writing, that wraps the underlying
Let's explore the APIs for reading and writing CSV files. There is a simplified API (backwards conpatible with previous SmarterCSV versions) and the full API, which allows you to access the internal state of the reader or writer instance after processing.

## Reading CSV

Convenient default allow automatic detection of the column and row separators: `row_sep: :auto`, `col_sep: :auto`. This makes it easier to process any CSV files without having to examine the line endings or column separators, e.g. when users upload CSV files to your service.

You can change the setting `:auto_row_sep_chars` to only analyze the first N characters of the file (default is 500 characters); `nil` or `0` will check the whole file). Of course you can also set the `:row_sep` manually.

SmarterCSV has convenient defaults for automatically detecting row and column separators based on the given data. This provides more robust parsing of input files when you have no control over the data, e.g. when users upload CSV files.
Learn more about this [in this section](docs/examples/row_col_sep.md).

### Simplified Interface

Expand Down
3 changes: 3 additions & 0 deletions doc/examples/row_col_sep.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ SmarterCSV defaults to automatically detecting row and column separators based o

These options can be overridden.

You can change the setting `:auto_row_sep_chars` to only analyze the first N characters of the file (default is 500 characters); `nil` or `0` will check the whole file). Of course you can also set the `:row_sep` manually.


# Column Separator

The automatic detection of column separators considers: `',', "\t", ';', ':', '|'`.
Expand Down

0 comments on commit 1c96425

Please sign in to comment.