473,769 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting bunch of Text File to Excel File using Visual Basic

2 New Member
I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Descriptio n is in the below:

The form should have the Drive list, Dir list, file list and cmdConvert button. Once pulling down the drive list and clicking to the specific drive, folders will be shown in the dir list. When clicking the folders in the dir list, files in that certain folder should apprear in the file list, but this program should limit only to show the txt files in the file list. Please consider that all txt files in that particular drive have the same format. Now when the intended txt files are now shown in the file list, you then have to click in the cmdConvert button. Each txt files in that certain folder will be converted into excel. The program will generate only one excel file for all the txt files converted.

This program is to make easy analysis of data using excel. Below is a sample of data inside the txt file, but please consider, its not only one txt file. Many txt files but the same format. Please consider that the below sample is not for business but for my own interest only to know regarding visual basic.

txt file:
_______________ _______________ _______________ _______________ ______
Bender Julie
Bending machine number a
cofffee size large
Date Blend Aug 25, 2007
space
space
space
Number of Cups released 5
Number of Customer 1
Coin used Standard
Customer rating ok
Customer Taste good

_______________ _______________ _______________ _______________ ______

The resulting Excel file should be in the below. Resulting format is in the row in a single excel sheet. I used comma instead of cell since I cannot insert a table here.

Excel file: Considering 5 txt file that I need to convert.

_______________ _______________ _______________ _______________ ______

Julie , a , large , 25-Aug , 5 , 1 , standard , ok, good
Chris , a , small , 25-Aug , 5 , 2 , standard , ok, good
Julie , a , small , 25-Aug , 5 , 1 , standard , ok, ng
Julie , a , medium , 25-Aug , 5 , 3 , standard , not ok, good
Chris , a , large , 25-Aug , 5 , 1 , standard , ok, good

_Sheet 1______________ _______________ _______________ ______________

Please anybody can help me on this.

Regards,
Chris
chrspta@yahoo.c om
Aug 25 '07 #1
1 2909
chrspta
2 New Member
CAN ANYBODY HELP ME ON THE BELOW.

I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Descriptio n is in the below:

The form should have the Drive list, Dir list, file list and cmdConvert button. Once pulling down the drive list and clicking to the specific drive, folders will be shown in the dir list. When clicking the folders in the dir list, files in that certain folder should apprear in the file list, but this program should limit only to show the txt files in the file list. Please consider that all txt files in that particular drive have the same format. Now when the intended txt files are now shown in the file list, you then have to click in the cmdConvert button. Each txt files in that certain folder will be converted into excel. The program will generate only one excel file for all the txt files converted.

This program is to make easy analysis of data using excel. Below is a sample of data inside the txt file, but please consider, its not only one txt file. Many txt files but the same format. Please consider that the below sample is not for business but for my own interest only to know regarding visual basic.

txt file:
_______________ _______________ _______________ _______________ ______
Bender Julie
Bending machine number a
cofffee size large
Date Blend Aug 25, 2007
space
space
space
Number of Cups released 5
Number of Customer 1
Coin used Standard
Customer rating ok
Customer Taste good

_______________ _______________ _______________ _______________ ______

The resulting Excel file should be in the below. Resulting format is in the row in a single excel sheet. I used comma instead of cell since I cannot insert a table here.

Excel file: Considering 5 txt file that I need to convert.

_______________ _______________ _______________ _______________ ______

Julie , a , large , 25-Aug , 5 , 1 , standard , ok, good
Chris , a , small , 25-Aug , 5 , 2 , standard , ok, good
Julie , a , small , 25-Aug , 5 , 1 , standard , ok, ng
Julie , a , medium , 25-Aug , 5 , 3 , standard , not ok, good
Chris , a , large , 25-Aug , 5 , 1 , standard , ok, good

_Sheet 1______________ _______________ _______________ ______________

Please anybody can help me on this.

Regards,
Chris
chrspta@yahoo.c om
Aug 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
35561
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
4
2470
by: mustafa | last post by:
Dear sir , I have built my application in visual basic 6.0 and crystal Report8.5 , Now i migrated my application to VB.net using the upgrade wizard.My visual basic form is upgraded to vb.net but my .dsr file that i created using crystalReport is not migrated , when i try to convert it into .rpt file using add new item in Vb.net Envs it give me the error in the log file saying,
3
10749
by: James Wong | last post by:
Dear all, I have an old VB6 application which can create and access Excel object. The basic definition statements are as follows: Dim appExcel As Object Dim wkb1 As Excel.Workbook Dim wks1 As Excel.Worksheet Set appExcel = New
3
2185
by: Mitchell Vincent | last post by:
Does anyone have some good examples of Excel automation with (VB).NET? I have some Excel spreadsheets that a customer needs parsed out but I've never tried to use Excel programatically before! Thanks! -- - Mitchell Vincent - kBilling - Invoices Made Easy!
2
5668
by: Rod | last post by:
I want to manipulate a spreadsheet from within dotnet (using VB). I cant figure out how to get started. i.e. what is the equivalent to the VBA code On Error Resume Next Set objExcel = GetObject(, "Excel.Application") If objExcel Is Nothing Then Set objExcel = New Excel.Application End If
1
2156
by: UKuser | last post by:
Hi Guys, I have a program which converts Excel spreadsheets to Javascript and allows interactivity. However it can't convert it to PHP, which is obviously better for users to view (in case J/S is turned off). How would I go about converting some of this created code (example JS below), or is there an easier way to get PHP to do the calculations itself? I am aware of an excel-server product but this is too expensive and doesnt actually...
2
1536
by: Agnes | last post by:
Which Reference I should Add If I want to delcare excel.application ? Thanks
5
10328
by: Testguy | last post by:
Hi, I was wondering if one the smart people that frequent this group could give me a hand with a small program I am attempting to debug. I am not a highly experienced developer, but can create small programs. I was asked to write a small application that would look in a folder, and convert all the CSV files to XLS.
7
3332
by: jetaw03 | last post by:
guys, can you help me to get data from a text file and putting it in an excel file? my programming language is visual basic 6.0 here is a sample data from the text file: ANO,BNO,TRANSDATE,TRANSTIME,ORIGINS,DESTINATION,CALL_TYPE,OUTROUTE,INROUTE,CALLS,ACTUAL_MINS,COST 0498373386,006623322001,20070216,16:33:35,SRO,THB,IDD,IBEF7O,,1,0.766666666666667,-0.014413 0498373386,006623322001,20070223,12:59:40,SRO,THB,IDD,0241,,1,0.8,-0.01264...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.