?
Solved

Import a text file and look for key Words

Posted on 2006-06-09
2
Medium Priority
?
156 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

762 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