We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Open WorkBook / CSV Cells Containing Delimiter

Thread ID:

Created:

Updated:

Platform:

Replies:

109289 Jun 6,2013 12:00 AM UTC Jun 13,2013 03:59 AM UTC Windows Forms 1
loading
Tags: XlsIO
Simon Finch
Asked On June 6, 2013 12:00 AM UTC

Is there a way to open a workbook / csv file that contains column data (text) containing the delimiter?

I have come across a problem that when i open a file that contains a cell with text including the delimiter, when i save the worksheet it screws up the column data positioning.

The code I am using is as follows:

    // Step 1 : Instantiate the spreadsheet creation engine.
    ExcelEngine  excelEngine = new ExcelEngine();

    // Step 2 : Instantiate the excel application object.
   IApplication  application = excelEngine.Excel;
                       
   // Open the file
   IWorkbook   workbook = application.Workbooks.OpenReadOnly(<FileName>);

   // Set Worksheet
   IWorkSheet worksheet = workbook.Worksheets[0];

   ***************************************************************************
   The worksheet contains mismatched data from file containing columns with delimiter in text
   ****************************************************************************
  
   // Save File
    workbook.SaveAs(fileName, ExcelSaveType.SaveAsXLS);

Cheers

Simon


Note File_6d187645.zip

Manoj Kumar G M [Syncfusion]
Replied On June 13, 2013 03:59 AM UTC

Hi Simon Finch,

Thank you for choosing Syncfusion products.

XlsIO provides support for reading and writing CSV files. The following code example illustrates how to open a .csv file with “,” as a delimiter.

// Opening a CSV File.
IWorkbook workbook = application.Workbooks.Open("CSVfile.csv", ",");


Please refer the below online documentation link for more information


Please let us know if you require any further clarifications.

Regards,
Manojkumar.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;