Permalink
Browse files

Fixed a problem with processing CSV lines containing empty fields.

Example:
- Before the fix:
  > (CSV:parse-string "1,2,3,,4,,5,,")
  (("1" "2" "3"))
- After the fix:
  > (CSV:parse-string "1,2,3,,4,,5,,")
  (("1" "2" "3" "" "4" "" "5" ""))

Discussion at the newLISP Fan Club about this issue is at
http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4334
  • Loading branch information...
1 parent e6f8db4 commit 959a62427643b63de640ab525f6240bd251f5ec5 Rick Hanson committed May 3, 2013
Showing with 1 addition and 3 deletions.
  1. +1 −3 csv.lsp
View
@@ -27,9 +27,7 @@
delimiter))
(define (CSV:regex-token-empty delimiter)
- (format "^%s(?:%s|$)"
- delimiter
- delimiter))
+ (format "^%s" delimiter))
; @syntax (CSV:make-row-parser <str-delimiter> <str-quote-char>)
; @param <str-delimiter> column delimiter

0 comments on commit 959a624

Please sign in to comment.