Hi,
I would like to convert an Excel spreadsheet into a text file through my WPF/Win forms application.
From here I need to parse this text file and retrieve important data from it.
The parsing of the text file is fine (i think), though how would I go about converting a excel file into a text file in C#?
Any help is appreciated.
Thanks,
Person.
Loading
theLizardPosted Dec 3, 2009, 4:50 PM
personPosted Dec 3, 2009, 6:29 AM
This is the link incase anyone else reads this and would like an example - http://www.c-sharpcorner.com/UploadFile/yuanwang200409/102242008174401PM/1.aspx
Thanks anyway!
Person.
personPosted Dec 3, 2009, 4:35 AM
I want the text file to be plain text.
I have an excel file, I want this to be converted 'as is' to plain text so that each row in the spreadsheet will be inserted as a line in the text file.
I will use regular expressions to parse the text file and retreive the objects necessary.
If anyone has any decent links to even a partial example so I can get my mind round how this process should work, would be appreciated.
Thanks greatly in advance.
Person.
Amit ChoudharyPosted Dec 2, 2009, 11:56 PM
you can fetch the complete excel sheet data into you Dataset using Microsoft.OLEDB.Jet.4.0 providers so ... whatever type of formatting you want you can create that programmatically. Then you can using the Sytem.IO to create the text file...
theLizardPosted Dec 2, 2009, 7:20 PM
This would depend on how you want columns to appear in the text file and what type of text file, plain text or RTF..