473,800 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

search and separate a string within another string?

Hello, I have 4,4 million rows of data in one column. I want to search
for a string in each line. There are random amount of characters
before the string I want to find. The string starts with the letter
"V" and I also know that after the letter V comes seven digits or
letters which I want to find also. After that string there are random
amount of characters. What kind of query I should create to find all
those strings within my data? I want also to separate them to another
column. What should I do?

Thanks for your help beforehand.
Nov 12 '05 #1
3 10571
Try using something like this

strKeyword = "string you want to find"

select *
from tblYourTable
where yourField like '*" & strKeyword & "*'"

That will only work if your looking for a known string, which now i think
more you dont want. Try making a function such as below and then using it in
your sql ;

function containsVthingy (strInput as string) as boolean
'do VB code to find the string you want
'lookup inStr
end function

select *
from tblYourTable
where containsVthingy (yourField) = true

if you wanted to save the Vthingy in another field you could just use an
update query, the main thing is you can use ur vb functions in queries.

Thats not accurate code but it should give you the idea and I hope Im not
leading you down the wrong path cause im no guru.
Hope it helps
John Sheppard

"harhaiko" <ha******@hotma il.com> wrote in message
news:fe******** *************** ***@posting.goo gle.com...
Hello, I have 4,4 million rows of data in one column. I want to search
for a string in each line. There are random amount of characters
before the string I want to find. The string starts with the letter
"V" and I also know that after the letter V comes seven digits or
letters which I want to find also. After that string there are random
amount of characters. What kind of query I should create to find all
those strings within my data? I want also to separate them to another
column. What should I do?

Thanks for your help beforehand.

Nov 12 '05 #2
So I guess doing it manually is out of the question? (Oh, just
kidding!)

Okay, the string starts at the first "V" Use InStr() to find it.
Something like instr(1,txtSear ch,txtSearchIn, vbTextCompare)

umm... Mid$(txtSearchI n,instr(1,txtSe archFor,txtSear chIn,vbTextComp are),8)

or something pretty close to that... HTH
Nov 12 '05 #3
Use LIKE in your selection criteria.

SELECT tblPart.Descrip tion
FROM tblPart
WHERE (((tblPart.Desc ription) Like "*V???????* "));

* matches anything including NULL
? matches any character

"harhaiko" <ha******@hotma il.com> wrote in message
news:fe******** *************** ***@posting.goo gle.com...
Hello, I have 4,4 million rows of data in one column. I want to search
for a string in each line. There are random amount of characters
before the string I want to find. The string starts with the letter
"V" and I also know that after the letter V comes seven digits or
letters which I want to find also. After that string there are random
amount of characters. What kind of query I should create to find all
those strings within my data? I want also to separate them to another
column. What should I do?

Thanks for your help beforehand.

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9021
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if I had C / \ B D
60
49204
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
32
14906
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
2
1568
by: David Lozzi | last post by:
Howdy, I am doing a simple keyword search in my SQL database from my ASP.NET w/ VB application. Currently, I am using a PROC and within the PROC I am doing something like so: SELECT * FROM tblStores WHERE strName LIKE '%' + @Search + '%' AND strCity LIKE '%' + @Search + '%' and so on This works GREAT for a single keyword like marshalls. However, if the user
3
2028
by: Russell | last post by:
Hey, ok i have numerous tables to search through for a 'site search'. some of the searchble fields have html embeded within so after some quick referencing, saw I can use the regExp function to strip out all the HTML leaving only the raw text. (done and works a treat) My issue is:
5
5058
by: vonclausowitz | last post by:
Repost from an VB group. Hi All, I'm looking for a way to search for multiple words in a database. There is however one but. The words have to be within a certain range of each other. For example I would like to find records which contain the word MALE and within for example 10 words of it the word BROWN.
3
9560
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and MusicAlbum let you find MP3 and other music files based on the singer and album name; DocAuthor let you find Office documents created by a certain user; DocAppName let you find files of a particular program, and so on. Indexing Service uses plug-ins...
12
12802
by: Eric Renken | last post by:
I have an application that I am adding support for plug-ins and I am looking for some help on the best way to handle this. My question has to do with AppDomains and the best way to use them. I have a directory structure like this: MyApp \AddIns \AddIn1 \AddIn2
0
2083
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
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...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10036
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...
1
7582
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
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
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.