Skip to content

Commit

Permalink
code refactor, can now modify headers via function, and slight perfor…
Browse files Browse the repository at this point in the history
…mance increase
  • Loading branch information
FourierTransformer committed Apr 2, 2016
1 parent f2083dd commit ee24dcd
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 139 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ ftcsv.parse("apple,banana,carrot", ",", {loadFromString=true, headers=false})
local actual = ftcsv.parse("a,b,c\r\napple,banana,carrot\r\n", ",", options)
```

- `headerFunc`

Applies a function to every field in the header. If you are using `rename`, the function is applied after the rename.

Ex: making all fields uppercase
```lua
local options = {loadFromString=true, headerFunc=string.upper}
local actual = ftcsv.parse("a,b,c\napple,banana,carrot", ",", options)
```

- `headers`

Set `headers` to `false` if the file you are reading doesn't have any headers. This will cause ftcsv to create indexed tables rather than a key-value tables for the output.
Expand Down
4 changes: 2 additions & 2 deletions ftcsv-1.0.3-1.rockspec → ftcsv-1.1.0-1.rockspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package = "ftcsv"
version = "1.0.3-1"
version = "1.1.0-1"

source = {
url = "git://github.com/FourierTransformer/ftcsv.git",
tag = "1.0.3"
tag = "1.1.0"
}

description = {
Expand Down
Loading

0 comments on commit ee24dcd

Please sign in to comment.