CSV to Excel Conversion - Windows Vs Linux

Hi Community,

I have a code that is working absolutely fine on a windows server. We were migrating our environments from Windows to Linux but the file share still is a Windows SMB. The Code works like a charm in windows and breaks in Linux. I tried using the path formatting so that Linux recognizes but still a failure. Any inputs would be appreciated.

-----------------------------------------Here is the code--------------------------------

//Get the Blank Excel template from the shared path
 String fileNamePath = props.getProperty("document.dynamic.userdefined.DDP_TemplateFileNamePath");
 String dataSheet = props.getProperty("document.dynamic.userdefined.DDP_DataSheet");

com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(fileNamePath);

// Open the RawData sheet
com.aspose.cells.Worksheet worksheetRawData = wb.getWorksheets().get(dataSheet);
com.aspose.cells.Cells cellsRawData = worksheetRawData.getCells();

// Import flat csv
int firstRow = 1;
int firstColumn = 0;
cellsRawData.importCSV(is, "|#|", true, firstRow, firstColumn);

// remove the first (empty) sheet
wb.getWorksheets().removeAt(0);

// Save to stream
ByteArrayOutputStream baos = new ByteArrayOutputStream();
wb.save(baos, SaveFormat.XLSX);

@abhinav4593,

Please elaborate what is the issue or error on Linux so we could help you through. If you find the issue regarding filePath, please make sure that you could access/get the filePath seamlessly in linux without any issue.

Hi Amjad,

It was a DNS issue on our end and we fixed it by rebuilding the DNS and adding on a mount path and it works like a charm now.

@abhinav4593,
We are glad to know that your issue is resolved. Please feel free to write us back if you have any other query in this regard.