We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Get CSV file Cell Format in java

Hi Team,

I need help on CSV file with java and Aspose.

I am trying to fetch the cell style from CSV file.

String workSheetName="D:\\ASPOSE\\ABC.csv";

Workbook csvWorkbook = new Workbook(workSheetName);

Cells cells = csvWorkbook.getWorksheets().get(0).getCells();

for(int i = 0; i <= cells.getMaxDataColumn(); i++){

Style style = cells.get(1, i).getStyle();

System.out.println(cells.get(1, i) );


I need the style as like General, Date etc.

Note : I am reading second line style..not fiirst line as its showing header which is all general format.

If I tries to print cell, I am getting date as like :Aspose.Cells.Cell [ E2; ValueType : IsDateTime; Value : 2014-09-04 ]

But actual CSV file have date in format 09/04/2014.

Kindly help me on :

1. Get the style of second row cell from CSV file like General, Date.

2. If CSV file have date in mm/dd/yyyy format, but cell value showing in dd-MM-yyyy format



One more thing would like to add here related to Date column,

if I open CSV file using excel then date column showing it as 'mm/dd/yyyy' format.

If I open CSV file using edit plus then date column comming as "dd-mm-yyyy" format.

I am expecting my code give me format of date column which is in excel file.



Hi Gauri,

Thanks for your posting and using Aspose.Cells.

CSV format does not support any Style objects, so retrieving Style related information from CSV format is useless. It will not return you any valid values.

However, as you want to read your date in mm/dd/yyyy format but Aspose.Cells always read it 2014-09-04, so we have logged this issue in our database for investigation. We will look into it and fix this issue. If you need to change your code, we will advise you that too. Once, the issue is fixed or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41014 - DateTime value is not read in correct format


Please try our latest fix/version: Aspose.Cells for Java v8.2.2.1

We have fixed your issue now.

Let us know your feedback.


Hi Gauri,

Thanks for using Aspose.Cells.

Please use the above latest version: Aspose.Cells
for Java v8.2.2.1
with the following option. i.e TxtLoadOptions.setKeepExactFormat(false)


TxtLoadOptions opts = new TxtLoadOptions();


wb = new Workbook(templatefile, opts);

The issues you have found earlier (filed as CELLSJAVA-41014) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.