473,766 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing Based On Capital Words.

1 New Member
Hey Guys,

I was hoping someone could help me solve a problem I'm having using vb2005 to parse a text file. I'm trying to parse the text file by Sentences that start with Words that are all Captial. Such as, IVORY is a type of Plant. Then place them into collections. I'm able to place them into collections fine, based on delimiters such as a comma.
I've tried to use the built in commands to do this. However they seem to only take fixed characters rather then muitiple ones.
example:

myreader.textfi eldtype= fileio.fieldtyp e.delimited
myreader.setdel imiters( string like [A-Z])

Any help you guys could offer would be great. Thx
May 22 '07 #1
2 1381
DigitalInvertor
21 New Member
You can try something like this... ;>

Dim ip As Integer
Dim triger As Boolean = False
Dim no As Integer
Dim word As Array

For ip = 0 To no - 1
Dim TheText As String
TheText = ---TXT---.Text.ToLower
Dim SearchString As String = word(ip)
If TheText.Contain s(SearchString) Then
triger = True
Else
triger = False
Exit For
End If
Next

If triger Then
'some code here
End If
May 22 '07 #2
DigitalInvertor
21 New Member
I forgot some code so here it is again...

Dim ip As Integer
Dim triger As Boolean = False
Dim no As Integer
Dim word As Array

word = ---TXT---.Text.ToLower.T rim().Split(" ")
no = word.GetLength( 0)

For ip = 0 To no - 1
Dim TheText As String
TheText = ---TXT---.Text.ToLower
Dim SearchString As String = word(ip)
If TheText.Contain s(SearchString) Then
triger = True
Else
triger = False
Exit For
End If
Next

If triger Then
'some code here
End If
May 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2154
by: filesiteguy | last post by:
I am coming up with a new site, which will be community-driven and subscription-based. I would like for people to go ato a URL that is friendly and easy to remember. Let's say my domain is mydom.com. I am a new user who just registered newsite as my name. I want to load a PHP file, but call it something other than - say - default.php. In other words, I want to load a pagedefault.php file which will pull information from a database based...
8
9445
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $ Last-Modified: $Date: 2003/10/28 19:48:44 $ Author: A.M. Kuchling <amk@amk.ca> Status: Draft Type: Standards Track
19
4009
by: ARK | last post by:
I am writing a search program in ASP(VBScript). The user can enter keywords and press submit. The user can separate the keywords by spaces and/or commas and key words may contain plain words, single quoted strings (phrases), double quoted strings (phrases). For example: Keywords: Jack, Jill, Jim, "Timothy Brown", Mary OR
2
2107
by: JaythePCguy | last post by:
Hi, I am trying to write a text parser to group all nonprintable and control characters, spaces and space delimited words in different groups using Regex class. Using a parsing of (?<Commands>)|(?<Spaces>)|(?<Text>+) on my sample text of \tOne\ncar red \fcar\a blue car\r\n \r\n does not work as indetended. Specially, the spaces are grouped as commands and the Text grouping ends up grouping words delimited by spaces. Here is the sample...
4
394
by: Nishanth | last post by:
Hi, I am facing a problem with one of the requirements. I am going to be getting a string data which I have to parse, The string data sample is something like below.
13
4512
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple command set consisting of several single letter commands which take no arguments. A few additional single letter commands take arguments:
2
2763
by: DCDeshpande | last post by:
Hi, I am new to Java and need to parse a simple txt file into unique tokens and store them in a data structure. Can someone please recommend the most efficient way to do this? I found out that StringTokenizer class can be used for parsing the text. I need to know the most efficient dynamic data structure available in Java to store the words and allow me to lookup words already in the list before adding new ones. Thanks, DCD
1
1891
by: alimsdb | last post by:
This code I have written but even Good not contains all capital words like GOOD the output of my code is All word is capital which is wrong. Can any one help me to solve this problem. my $element = "Good"; if ($element =~ //g) { print "All word is capital"; } else
5
1319
by: 1337kamikaze | last post by:
I want to be able to take What is the Capital of California?/Sacramento/Redding/Georgia/Iran/A from a text file and seperate it into seperate strings between the / so it would have like String question = "What is the Capital of California? String answer1 = "Sacramento" etc
0
9404
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
10168
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
10008
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...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
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...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
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.