-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Data Transformations | ||
|
||
SmarterCSV automatically transforms the values in each colum in order to normalize the data. | ||
This behavior can be customized or disabled. | ||
|
||
## Remove Empty Values | ||
`remove_empty_values` is enabled by default | ||
It removes any values which are `nil` or would be empty strings. | ||
|
||
## Convert Values to Numeric | ||
`convert_values_to_numeric` is enabled by default. | ||
SmarterCSV will convert strings containing Integers or Floats to the appropriate class. | ||
|
||
## Remove Zero Values | ||
`remove_zero_values` is disabled by default. | ||
When enabled, it removes key/value pairs which have a numeric value equal to zero. | ||
|
||
## Remove Values Matching | ||
`remove_values_matching` is disabled by default. | ||
When enabled, this can help removing key/value pairs from result hashes which would cause problems. | ||
|
||
e.g. | ||
* `remove_values_matching: /^\$0\.0+$/` would remove $0.00 | ||
* `remove_values_matching: /^#VALUE!$/` would remove errors from Excel spreadsheets | ||
|
||
## Empty Hashes | ||
|
||
It can happen that after all transformations, a row of the CSV file would produce a completely empty hash. | ||
|
||
By default SmarterCSV uses `remove_empty_hashes: true` to remove these empty hashes from the result. | ||
|
||
This can be set to `true`, to keep these empty hashes in the results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters