Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Import a text file and look for key Words

Posted on 2006-06-09
2
Medium Priority
?
157 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

610 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