![]() |
Click here to advertise with us
|
|
|||||||
| Database General Discussion General discussion on database related topics |
![]() |
|
|
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! |
|
|||
|
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 |
|
|||
|
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@@@@@@@@ -------------------------------------------------------------------------- |
|
|||
|
|
|
||||
|
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?
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|