You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,25 @@ file:close()
180
180
localoutput=ftcsv.encode(everyUser, {encodeNilAs=0}) -- for setting it to 0
181
181
```
182
182
183
+
-`allowMissingKeys`
183
184
185
+
If set to a non-`nil` value, this option allows encoding data sets that are entirely missing a field that was specified in `fieldsToKeep`. Otherwise, ftcsv would raise an error.
186
+
187
+
```lua
188
+
localdata= {
189
+
{a=1, b=2, c=3},
190
+
{a=10, b=20},
191
+
{a=100, c=200},
192
+
}
193
+
ftcsv.encode(data, {fieldsToKeep= {"a", "b", "c", "d"}}) --> [throws an error]
ftcsv returns a litany of errors when passed a bad csv file or incorrect parameters. You can find a more detailed explanation of the more cryptic errors in [ERRORS.md](ERRORS.md)
0 commit comments