now i search for the word basic.if i press the button find. the first "basic must highlighted, and then if i press again the button the next "basic" is the highlighted one and so on.I already finsih that scenario. What i've done is that first im going to search all the positions of the word and then store it in a array. Then after the array populated with different location of the word that is searching. that is the time i call all the indexes of the array one by one. But i don't want my approach because imagine i have 10000 words. and i search for a word or letter. Lets say the result is 5000 match. so it needs my array to be size in 5000. what a mess in memory.
I don't want to used the FinsString or Find function of VB i want some algorithm to do this. Anyone have a easy approach..
I am not an ardent developer in vb.net programming. But off late I am using vb.net to develop a windows application.
The following is what I am trying to do:
I am reading an excel file and storing the string value present in each cell, and trying to match the string in a word file.
The program works fine except that I am having problems in returning the page numbers of the matched string.
The page number value is always returned as one.
The following is a piece of what I had written:
If FindStringInFile(wordfilename, vValues) Then currentPageNumber = word.ActiveDocument.ActiveWindow.Selection.Range.Information(Microsoft.Office.Interop.Word.WdInformation.wdActiveEndAdjustedPageNumber) TextBox3.Text = currentPageNumber End If
wordfilename is my word file and vValues is my excel string data
Here at my company we have an Access application that allows users to create documents based on invoices that are in Great Plains. Documents such as invoices, packing lists, export documentation, etc., etc.This application is very old and very hard to maintain so we're doing a rewrite and I've chosen this project to be my first Visual Basic .NET project.
I'm trying to write a function to find a word in a string in the this format : "ThisissometextthatIneedtofindandthisisthetext. This is another text."It's read as " This is some text that I need to find and this is the text. This is another text." but there is no space between each word. I want to get the word "text" or any word in that string. Can you help me with this function with a code sample ?
And I think that this method can be implemented with a string of Unicode also because in a sentence of Unicode it contains one or few, sometimes zero spaces between each word.
If the documents are created using Excel 97 or Word 97 the files are found. If the the documents are created using Excel 2007 or Word 2007 the files are not found.
I have checked the permissions between the two different versions and they appear to be the same.
why Dir dosen't work with Excel 2007 and Word 2007 files?
I got a situation where i have the first word only of a a child window and the rest of the name changes. I need to find this child window using findwindowex i think by not knowing the full name.
Searching the processes wont work since it is a child.
I am finding specific words in the RichTextBox (in this case, "Hey!") and selecting them by getting their initial position through the "Find" command. Unfortunately, this does not work when I have multiple instances of "Hey!" in the RichTextBox. Here's an example:
Text in RichTextBox: Hey! This is cool!
The Find command would return a value of 0 in this case. However, let's take a look at another scenario:
Text in RichTextBox:
In this case, the Find command would return a value of 0 again, but I want it to get the initial position of the second "Hey!" statement. I'm wondering how I can do this.
I've got an issue with a program I am writing. The specific issue is replacing characters in a parent string by finding, and matching, specific characters within it that are parsed from an external xml file. It's for a chat-like client.Here's the 2 classes I am using to pull the emote strings, titles, and id from external XML:
Imports System.Text.RegularExpressions Imports System.Xml.Serialization Public Class emote
i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this?t i use is shown below
Dim myArray(10000) as string Dim strArray As New System.IO.StreamWriter("c:List.txt") strArray.WriteLine("{0,10}{1,30}", "Index", "Symbol")
i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this? i am using visual basic express 2008. The code that i use is shown below
I have a somewhat unique problem that I have looked for an answer to and continually hit brick walls. The problem is this. I'm using vb.net to read a byte array from memory which total 32768 in length, which is converted to a string. The memory is the active console chunk in the game Call of Duty 4.
I am trying to create a function that searches each line of a richtextbox and returns that row if one of many search phrases are found.The app works wonderfully when used with longer words or muli word phrases as the search criteria.The problem I have is if the search word/ criteria contains a small string such as bae or sp then I get alot of false positives. Anytime bae or sp is found within any word it returns the results.I need the function to stop looking within the words for results and instead look at the word as a whole for a match.Below you can see that I am taking each line of text in the richtextbox, removing most non-alpha numberic characters and replacing them with spaces.Then I have it remove any double spaces with single spaces.For the search term list I have it take the text before the delimiter;and do the same.Trouble I am having is,if the search term is SP and the search phrase is "This is a space shuttle lauch"it will return the sentence since the sentence contains the word "space" which starts with sp.[code]
My problem seems simple but I can't find an answer for it.I need to be able to pull a phone number (string) from an entire string. example: "My phone number is (xxx) xxx-xxxx, call me as soon as possible."
Its obvious to me that the phone number should be able to change depending on who you are talking too. So the question becomes, how do i search for the phone number's format within the above string?
I think VB has a way of doing this, but for the life of me I can't find it. I want to search through a string for anything contained between two certain characters, e.g between 2 | characters. I'm not sure if I want to split the string at this point, but I only want anything contained between the two | markers. So for example if the string reads |ABC|DEF I only want to retrieve the ABC, but not the DEF as it's not completed yet.
I want to be able to find both spaces using the indexof method. Here's my code so far. Basically the program will turn the string "Will Smith" to "Smith, Will" But I noticed when I type in a name with a middle initial or middle name "Will J Smith" I would get "J Smith, Will" And I want to be able to find that second space when its there and apply a code that would produce "Smith, Will J" When there is a second space. How would I go about doing so?
Ive got a question about finding the greatest value in a string. I am connected to a database but I am positive that part is right. So i posted here instead of there.
Dim x As Double Dim ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=DBASE.MDB"
[Code]...
How do I make my If..Then statement return the highest value of row 0's x? My output (by changing the if then statement) will either return the first or last entry in row 0. I hooked up my code to a list box and got all the data to list perfectly i just don't know how to get the highest number after i use the formula for x (which is {c1-c2}/c2).
I made a Windows service which daily deletes some records from a SQL Server database. But i don't know what my connectionstring should look like ... the service and the database will both be located on the server.I found this example, which parts do i need to change ?
Basically what I'm trying to achieve is to extract all the words within a piece of string and transfer that from one text box to another text box.
An example piece of the string would be
<laugh:894u8438:4434:words>
However the words within the string will never remain constant and the characters before and after will change. Is there anything that will read the string and take a word from the string without it being pre-programmed. The string it is reading from is uploaded from a text file.
Problem: Your task is to take input from the user in string and give the following options to the user in a menu.
1- Find a String 2- Create sub-string 3- Erase a portion of a sting 4- Replace a word in the string 5- Count number of words and characters in the string without spaces. 6- Capitalize first character of each new sentence and convert the rest of the characters to lower case. 7- Sort all the words in alphabetical order. (Use Bubble sort algorithm to perform sorting).
To perform all the above mentioned tasks you can only use pointers. Create a function to perform every task.
I have a networkstream (using C#/VB.NET). while on reading values coming like this:
&% 68 kg K A&% 23 kg K A&% 174 kg K A &% 68 kg &% 34 kg K A&% 2334 kg K A&% 68 kg K A &% 68 kg K A &% 2348 kg K A&% 78 kg K A&% 28 kg K A&% 68 kg
The numerical(weight) value will be continuously varying.
Every time i am reading the starting of the stream differs. But the pattern remains the same. How to split that into '&% 78 kg K A' which represents one set.
How to extract the weight value from this stream using Regex or any other methods?
I have a text file that is automatically generated by an older computer system daily. Unfortunately, the columns in this file are not delimited and they are not exactly fixed width (each day the width of each column could change depending on the amount of chars of the data in each column). The file does have column headings, so I want to find the width of each column using the column headings. Here is an example of the column heading row:
JOB_NO[variable amount of white space chars]FILE_NAME[variable amount of ws chars]PROJECT_CODE[variable amount of ws chars][carriage return]
What I want to do is get the index of of the first char in a column and the index of the last white space of a column (from the column heading). I would want to get the index of the "J" in JOB_NUM and the last white space before the "F" in FILE_NAME for the first column.I guess I should also mention that the columns may not always be in the same order from day to day but they will have the same header names. I know I can use the string.indexOf("JOB_NO") to get the index of the start of the column, but how do I get the index of the last white space in each column? (or last whitespace before the next first non-whitespace that denotes the start of the next column)
I am working on a program and for one of my features, I need to replace all spaces in a program with - (dashes.) Is there a way in which I can do this?
Example: Start String = "The rain in Spain falls mainly in the plain." End String = "The-rain-in-Spain-falls-mainly-in-the-plain."