I have attached the files, which I have created using Aspose 184.108.40.206 as well as 7.
Dear Amjad Sahi,
Believe you missed the scenario,. We need to automate the conversion and please be informed that it is NOT SUPPOSED TO HAVE ANY MANUAL INTERVENTION.
If this is not supported, I may not go for conversion process at all. Instead, I can read the CSV file and can write the XLS file using Aspose. To avoid such difficult process, I am doing this direct conversion. Without this, your conversion code may not be of much use to us.
Ex: Date: 26/10/2011 (dd/MM/yyyy) is converted as 10/03/2013 .
PS3: If things are not sorted out, we are forced to look for other alternatives.
Ex: Date: 26/10/2011 (dd/MM/yyyy) is converted as 10/03/2013 ."
Dear Amjad Sahi,
Thank you for your feedback. Yes, we understand and thank you for your understanding and patience. And we always try to make our product more enhanced, stable and flexible for users.
For your another issue and question:
1).The datetime in CSV template file be changed as double value:
We will provide you a fix in this week to solve this issue.
2).Date: 26/10/2011 (dd/MM/yyyy) is converted as 10/03/2013:
Yes, it should have been fixed in our latest fix because we cannot reproduce it here. And we don't think there are other known issues for it.
3).Java Heap Space/out of memory issues for large csv files:
We think you can avoid to hold all CSV files(all Workbook objects) in memory at the same time. You can combine CSV files one by one by yourself. Please refer to the followng code:
Workbook resultBook = new Workbook();
WorksheetCollection resultWss = resultBook.getWorksheets();
Cells resultCells = resultWss.get(0).getCells();
int count = 0;
for(int i=0; i<files.length; i++)
Workbook tmpBook = new Workbook(files[i]);
Cells tmpCells = tmpBook.getWorksheets().get(0).getCells();
int nextCount = count+tmpCells.getMaxDataRow()+1;
if(nextCount > 65536)
resultCells = resultWss.get(resultWss.add()).getCells();
nextCount -= count;
count = 0;
resultCells.copyRows(tmpCells, 0, count, nextCount-count);
count = nextCount;
Moreover, if you only want to combine and save multiple CSV files as one XLS/XLSX file, we think you can try LightCells APIs, which will save more memory for you.
Please try the attached version: v220.127.116.11.
We have fixed the issue of reading DateTime value "Jan 01, 2004 12:00:00 AM" as double issue.
For LightCells API, it is used for a to create large xls/xlsx files with large cells dataset. In this mode a user provides cells data in saving process and the component will save those data directly into the resultant file without building the complete data model in the memory. In this way certain, the amount of memory may be saved because not many cell/row objects are built in memory. However, because those cells data is not in memory, so those operations and models that need those cells data will not work at runtime, such as, calculate formulas, create pivottables, ...etc. If it can fit your requirement, we will provide you sample code next week to show its usage.
Dear Amjad Sahi,
Attached is an example program to show how to combine multiple CSV files into one final workbook and save the workbook in Light mode. Hope it can help you for your situation.
The issues you have found earlier (filed as CELLSJAVA-xxxxx) have been fixed in this update.,
Dear Amjad Sahi,
One more issue with the new jar is, setAutofitcolumns() method is not working.
We would also like to bring to your kind notice that, it is really difficult for us to stop our development activities and to test your jar extensively for breakages, in turn that has a impact in tasks we have planned. The key point is we would like to have a stable build (well tested for all the use cases, free from breakages and with all the reported issues fixed) and less number of mail threads.
TxtLoadOptions lo = new TxtLoadOptions(LoadFormat.CSV);
Workbook workbook = new Workbook(“Store_Sales.csv”, lo);
Thank you for your template file. We have re-built our parser for reading text format template file to recognize more formated values from V7. The rebuilt parser fits more requirements of some users, but it is really a complicated task for us to make it give exact the same result with what shown in ms excel for all situations. We will try to improve the parser in later fix and versions. Currently if you required, we can make the formatting as “HH:mm:ss” instead of “H:m:s” for your situation. But at the same time, the values with “H:m:s” formatting in csv template will also be converted to formatting “HH:mm:ss” too.
Another option for you currently is to implement your custom parser for your specific template file, here is the code example for your reference.
For the issue of autofit columns, we cannot find it by using your given csv file. If you found this issue with our latest fix, please provide us the template file and code to reproduce it, we will look into it.