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.

Import to Excel Spreadsheet from Text File

Thread ID:

Created:

Updated:

Platform:

Replies:

124095 May 16,2016 12:52 PM May 19,2016 02:27 AM Windows Forms 3
loading
Tags: XlsIO
Josh Hill
Asked On May 16, 2016 12:52 PM

Is XlsIO able to import from a text file into an Excel spreadsheet?

I have text files (there are no file extensions, only names) which are semi-colon or tab-delimited files. I need to import the data into Excel spreadsheets and in some cases to databases too.

I can import the data to databases using OLEDB.ACE.12.0, and right now, the files are being converted and loaded using VBA macros which run unattended every night. This is a poor practice and I'd like to eliminate the need for the Office suite on the server.

I haven't found a library which can convert text files into xls-format files yet. I have one which uses the OpenXML format and the OpenDocuments library to import text files but it only creates xlsx files. If XlsIO can do the same job and save as an xls-format file (Excel 97-2003 format), then I'll switch.

Nothing in the documentation indicates the ability to import from a text file; I did find documentation for importing from a data table, but I'd like a library which doesn't need that interim step.

Any information greatly appreciated, and thanks in advance!

Warm regards,
Josh

Sridhar Sukumar [Syncfusion]
Replied On May 17, 2016 06:49 AM

Hi Josh, 
 
Thank you for contacting Syncfusion support. 

Regarding Importing data from text file: 

Yes, you can able to import data from a text file (with separator) into an Excel spreadsheet using XlsIO. We have shared a sample illustrating this behavior for your reference which can be downloaded from the following link.   
  

Please try this sample and let us know whether your requirement is achieved. 

Regarding Exporting to DataTable : 

Yes, you can export the imported data from the text file to a DataTable using ExportDataTable method and a brief explanation for exporting worksheet to the DataTable is available in the following UG documentation link. 

Please let us know if you have any concerns. 

Regards 
Sridhar S 


Josh Hill
Replied On May 18, 2016 12:31 PM

Hi, Sridhar,

Thank you for your response. I'm having trouble with the solutions, however. The VS 2013 version won't load in VS2013, and the 2012 version can't find the assemblies required for the examples.

I'm sorry, I must have missed something. Do I need to first download the library before I can use the examples? Are the assemblies not part of the samples?

Let me know how to use them and I'll be glad to look them over. If I need to download the assemblies, please let me know and I'll get that done as soon as possible.

Sorry for my ignorance on this, and thank you again for your help.

Warm regards,
Josh

Sridhar Sukumar [Syncfusion]
Replied On May 19, 2016 02:27 AM

Hi Josh, 
 
Regarding VS 2013 solution issue: 
 
Due to some improper project settings, you might not be able to open Visual Studio 2013 solution file in Visual Studio 2013. So, we have modified the sample in which solution files will be opened in their respective Visual Studio version. The modified sample file can be downloaded from the following link.  
 
 
Regarding assembly reference issue: 
 
Yes, you need to install Syncfusion Essential studio in your machine to run this sample. The latest version of Syncfusion Essential studio can be downloaded  from the following link: 
 
The following assemblies must be referred from GAC to run this sample 
·       Syncfusion.Compression.Base 
·       Syncfusion.XlsIO.Base 
To know more about assemblies required, please refer the following UG documentation link. 
 
 
Please let us know if you have any concerns. 
 
Regards 
Sridhar S 


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.

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.

;