Skip to content

Commit ee24dcd

Browse files
code refactor, can now modify headers via function, and slight performance increase
1 parent f2083dd commit ee24dcd

File tree

4 files changed

+192
-139
lines changed

4 files changed

+192
-139
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ ftcsv.parse("apple,banana,carrot", ",", {loadFromString=true, headers=false})
6060
local actual = ftcsv.parse("a,b,c\r\napple,banana,carrot\r\n", ",", options)
6161
```
6262

63+
- `headerFunc`
64+
65+
Applies a function to every field in the header. If you are using `rename`, the function is applied after the rename.
66+
67+
Ex: making all fields uppercase
68+
```lua
69+
local options = {loadFromString=true, headerFunc=string.upper}
70+
local actual = ftcsv.parse("a,b,c\napple,banana,carrot", ",", options)
71+
```
72+
6373
- `headers`
6474

6575
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.

ftcsv-1.0.3-1.rockspec ftcsv-1.1.0-1.rockspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package = "ftcsv"
2-
version = "1.0.3-1"
2+
version = "1.1.0-1"
33

44
source = {
55
url = "git://github.com/FourierTransformer/ftcsv.git",
6-
tag = "1.0.3"
6+
tag = "1.1.0"
77
}
88

99
description = {

0 commit comments

Comments
 (0)