![]() |
|
|||||||
| Winforms Data Access VB.NET development for data access and back-end related areas |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all,
may i ask how do I convert an Excel file(.xls) into a text file(.txt) using VB.NET. Does anyone have the coding for this? thanks a million! |
|
||||
|
That's like saying "how do i convert an mp3 into a jpeg?" You'll need to be more specific about the layout of both files.
Also your question has little to do with Visual Studio itself (the environment you write programs in) so this is probably the wrong forum
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ Last edited by cjard; 11-25-2008 at 8:45 PM. |
|
|||
|
hm.. i would say. the excel data would be extracted from a database into like a gridview format. from there, it should be converted into a txt format with the use of delimiters to end a line.
|
|
||||
|
you can use the automation (loading excel into memory as an object and using it programmatically) to convert the file to csv..
..or you can use the Microsoft Jet database driver in excel mode (ConnectionStrings.com - Forgot that connection string? You will find it right here!) to access it like a db, read the file into a datatable, and then write it to disk as delimited text See my recent edit to the other post about this topic being in the wronf section
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ |
|
|||
|
Firstly, i would be selecting the excel file which is pulled from macpac, from my computer, next i would click on the button convert.
Once converted, it would generate a text file. which looks something like that -------------------------------------------------------------------------- BANK@@@@7010052@@@@@@@@@@@@@@@@@@@@@@@65123465@@@@ @@Orderin Party@@@@Sin Cash@@@@@@65123369@@@@@@@@ -------------------------------------------------------------------------- |
|
||||
|
can you provide by way of forum attachment, a "before" and "after" file youre expecting from this process?
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ |
|
|||
|
|
|
||||
|
using a connection string you find at ConnectionStrings.com - Forgot that connection string? You will find it right here! and the "Microsoft Access Database driver" in visual studio (for it is the Jet driver, it's just that jet can access excel too), [or OleDb if youre doing it in code rather than visual designer] are you able to connect to the spreadsheet and read its contents into a datatable?
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|