Solved

Import a text file and look for key Words

Posted on 2006-06-09
2
153 Views
Last Modified: 2010-04-30
Hi EE

I am importing a text file into vb, which I can do

What I want to do is to have a look at the line in the text file and either split of filter different words and was looking at the best way to do it.

The information in the text file is like

advertising this is a general advertising query
general this is a general query
general this is a general query2
website this is a website query

so when I import the text file to the database I want col1 to be advertising and col2 to be "this is a general advertising query", then the next line col1 would be general and col2 would be "this is a general query" and so on, what would be the best way to achieve this

Thanks in advance

Paul

0
Comment
Question by:Paulstott
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 16869114
Hi Paulstott,

For each line you return you would need to do something like:

Dim lngPos as long
Dim Col1 As String
Dim Col2 As String
lngPos = Instr(MyLineFromFile," ")
Col1 = Left(MyLineFromFile,lngPos)
Col2 = Mid(MyLineFromFile,lngPos+1)

Tim Cottee
0
 
LVL 1

Author Comment

by:Paulstott
ID: 16869147
Thanks for the quick response
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question