Ritu Joshi
asked on
how to wrtie "null" for every blank cell while converting excel to csv in java.
language: Java
i have one bank statement in xls format , which i already convert into csv format in java . and display in jsp ,but how user can recognized the amount is debit or credit because it come in one column i.e amount . and after edit form jsp it will save in database , where two different column for debit and credit .....
Problem: In excel File : there is two column Debit Amt. and credit Amount , but the transaction will be debit or credit , but when i convert into csv file , it not write null on blank cell . i
used missing policy ,
case Cell.CELL_TYPE_BLANK:
data.append("***" + ",");
break;
but it work on total blank column , not a every blank cell .
Kindly guide .Thanks in advance .
i have one bank statement in xls format , which i already convert into csv format in java . and display in jsp ,but how user can recognized the amount is debit or credit because it come in one column i.e amount . and after edit form jsp it will save in database , where two different column for debit and credit .....
Problem: In excel File : there is two column Debit Amt. and credit Amount , but the transaction will be debit or credit , but when i convert into csv file , it not write null on blank cell . i
used missing policy ,
case Cell.CELL_TYPE_BLANK:
data.append("***" + ",");
break;
but it work on total blank column , not a every blank cell .
Kindly guide .Thanks in advance .
And why transforming the slightly better format (Excel) into the worst (CSV)? Why not something more modern (XML, JSON)?
Then you mentioned transactions: What is your use-case/task?
Then you mentioned transactions: What is your use-case/task?
ASKER
@Ste5an - hi, thanks for the comment, actually i have a module in which user will upload .xls file (bank Statment) and , it will display as report in jsp and then , user can edit data accordingly and then save to database . but when i convert in csv using java , it convert all the thing , but ignore the blank field , so the debit /credit column sometime has value sometime not ..., example
SNO,PDATE,VDATE,CHQNO,DES, DEBIT,CRED IT,BAL,
31523,1.6.2018,2.06.2018,5 6000310896 9,To Clg BHARTI AIRTEL LIMITED,23242,16,44,03,453 .26,
SNO,PDATE,VDATE,CHQNO,DES,
31523,1.6.2018,2.06.2018,5
ASKER
@Ste5an - hi, thanks for the comment, actually i have a module in which user will upload .xls file (bank Statment) and , it will display as report in jsp and then , user can edit data accordingly and then save to database . but when i convert in csv using java , it convert all the thing , but ignore the blank field , so the debit /credit column sometime has value sometime not ..., example
SNO,PDATE,VDATE,CHQNO,DES, DEBIT,CRED IT,BAL,
31523,1.6.2018,2.06.2018,5 6000310896 9,To Clg BHARTI AIRTEL LIMITED,23242,16,44,03,453 .26,
SNO,PDATE,VDATE,CHQNO,DES,
31523,1.6.2018,2.06.2018,5
ASKER
it has 8 column , but value only 7 ? becuse it ignore balnk , i want it print null aginst blank cell in csv .
So - you're converting it wrongly. You need to post your conversion code
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
a. attach sample spreadsheet
b. post handling code in code tags