java - How to check that the value of column in particular row is not null and is also tab delimeted -


i parsing .csv file tab delimited. can see, there arrows in place of tabs; because have enabled "show characters" option in notepad.

aaa->bbb->ccc->crlf  agf->jui->kje->awecrlf  bvg->qaz->plm->yhbcrlf 

now am using csv beans 0.7 parser parse .csv file , getting objects each columns

if(f.getaaa() && f.getbbb() && f.getccc() && f.getddd()) // getting value of row1 agfjuikjeawe   { } 

now .csv file received backend, it's possible value of column null, shown below

aaa->bbb->ccc->crlf  agf->->kje->awecrlf  bvg->qaz->plm->yhbcrlf 

i putting condition check null values, but, can see, if value not there tab is, condition check correct

if(f.getaaa()!=null && f.getbbb()!=null && f.getccc()!=null && f.getddd()!=null)   { } 

i don't know library you're using, plain java use split(string) method of string in each of lines of csv file this:

final string s = "abc\tefg\thij"; final string [] values = s.split("\t"); system.out.println(arrays.tostring(values)); 

edit: "\t" argument of method special character of tab. then, check elements in array empty string, null value.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -