When we read a csv file using java and tokenize it using StringTokenizer ,and if we encounter a blank space how to save that empty space as null.
Example: Supposing we have a string "abc,xyz, ,str,".
When we read it, it is taking as a line including the space.But when we tokenize it the output is :
abc
xyz
str
But I want the output as:
abc
"empty space"
xyz
"emptyspace ", so that I can replace the empty space with null value while inserting into the database.
Thanks in advance.
Example: Supposing we have a string "abc,xyz, ,str,".
When we read it, it is taking as a line including the space.But when we tokenize it the output is :
abc
xyz
str
But I want the output as:
abc
"empty space"
xyz
"emptyspace ", so that I can replace the empty space with null value while inserting into the database.
Thanks in advance.
Comment