Menu

#30 Add option for empty cells to be empty string vs null

Outstanding
wont-fix
nobody
None
1
2013-11-19
2013-04-02
No

when you call CsvListReader.read(), an empty cell gets returned as null. For my needs, an empty String would be more useful (and safer, no inadvertent NPEs). The ConvertNullTo() cell processor won't work because I don't always know how many columns I will be reading (and some have varying numbers of columns)

Can you perhaps add an option (to CsvPreferences?) to allow for deciding how an empty cell is rendered?

Discussion

  • James Bassett

    James Bassett - 2013-04-05

    Hi Keith,

    That would be possible, but I think it's better to use ConvertNullTo as you suggest. I've updated CsvListReader for the next release so it will be possible to execute cell processors separately from reading (feature request 31), which is really the heart of your problem.

    James

     
  • Keith Roberts

    Keith Roberts - 2013-04-12

    I still think there might be some value to having the option specifically for empty cell handling, but your change certainly solves the problem.

    Thanks,
    Keith

     
  • James Bassett

    James Bassett - 2013-11-19
    • status: open --> wont-fix
     
  • James Bassett

    James Bassett - 2013-11-19

    Not fixing - simple solution is to use ConvertNullTo()

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.