Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 10th, 2004, 04:50 PM
Authorized User
Join Date: Jul 2004
Location: New Providence, NJ, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Working with .txt files

I'm embarrassed to ask, but I'm stumped....

How do I open a .txt file and then manipulate the text? Is it simply a matter of referencing a library, or does it get more complicated than that? I am trying to automate a search and replace within a .txt file. I had a procedure that used SENDKEYS, but now that my PC has been upgraded to Windows XP/2003 my old VBA doesn't work anymore.

This can't be hard to do, can it?

Reply With Quote
  #2 (permalink)  
Old September 10th, 2004, 05:22 PM
Friend of Wrox
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post

What application will you be using excel or access?
if you will be using excel:
1. Open file with Excel for windows.
2. Click on the first column heading. This will hightlight the first column of the spreadsheet.
3. From the File menu select Data --> Text to Columns...
4. Choose Delimited and next.
5. Check tab, comma or however it fits you.
6. Your datas should now have diff. columns.
7. Select finish.

if you will be using access:
1. Open access app.
2. Select File --> Get external data --> import
3. Select the textfile.
4. continue

Hope this helps.

Reply With Quote
  #3 (permalink)  
Old September 10th, 2004, 10:05 PM
Authorized User
Join Date: Jul 2004
Location: New Providence, NJ, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

I may not have been clear in my initial post.

I have a text file that has a big chunk in the middle of it that I must replace with another big chunk. I am trying to automate the copy and paste process that I have used NotePad to accomplish. In my original procedure I used SHELL to open NotePad and then used SENDKEYS to highlight what I wanted in file #1. I would copy that to the clipboard and paste in into file #2 - again using the very inelegant SENDKEYS approach.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
WHERE IS THE TXT FILES OF BOOK? PedroPN BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 2 July 5th, 2007 10:32 AM
Uploading txt files arnabghosh Classic ASP Basics 1 June 15th, 2005 04:44 PM
where to put startup txt files mp VB.NET 2002/2003 Basics 2 March 24th, 2005 09:34 AM
data from txt files to access db citizen99 Access VBA 3 January 25th, 2005 12:50 PM
Linked Tables to non *.TXT files chrislepingwell Access 0 July 21st, 2004 07:05 AM

All times are GMT -4. The time now is 01:48 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.