*** Searching Any Word From Text File ? ? ? ***
heloo....
i am using vb and asp with sql server 2000 for devloping my new project.... i am new to asp ...... my project is almost over
now i want little help....
i want to search a specific word enter by user in text box(in vb form or asp form) from text file.
is there is any way to find any word from text file.
thanks in advance.........
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Searching For A Directory Vs Searching A Text File For The Same Thing!
After working on a piece of code for a while, and actually getting it to work, I was asked to do it a different way.
Originally, I had a login box set up to search for a user's username and password that was stored in a text file. The problem with this was that I didn't know how to get it to search ALL of the entries, not just a set 1 to 10 like I was using in my code. To see the full program code, click here.
Now my group members want me to do it so that it searches for the directory instead of the text file for the same information. The directory name is the username, and in the directory, they'd like (theoretically speaking) to have the user's username and pass stored in a pwd file or a txt file.
I'm trying to argue that searching a text file's easier (partly because I believe it is, and also because I've already done it), but they're arguing that searching the directory's easier because then, the program could just store the directory in a global module, so when it comes to other aspects of the program itself, it'd be easier to do.
I'm willing to give the 'searching for the directory' route a try, but I can't seem to find anything that pertains to this, WITHOUT using api (I've searched the forum, and all I found was recursive search for stuff thats already in a directory, or stuff that has to do with api).
Any help would be greatly appreciated.
Searching For Text In A Word Doc
I have several Word .doc files in a directory and I need to search
all of them to see if a certain string of text is found. I don't want
any of the documents to be opened, I just want the name(s) of
the documents that the text is found in to be returned to the
user and give the option to open the document(s).
All my code does so far is open a single document:
Code:
Option Explicit
Dim wordApp As Word.Application
Private Sub Form_Load()
Set wordApp = New Word.Application
wordApp.Documents.Open App.Path & " est.doc"
wordApp.Visible = True ' optional
wordApp.Activate ' optional
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set wordApp = Nothing
End Sub
Searching Through A Text Box For A Word
Hi,
I would like to search through a text box called txtText and look for the word "system". If this word is found I want it to be changed to "System" (notice that the latter's first letter is UCase). If it is found I want it to search on after making the changes and see is it is any where else. Just like the replace feature on Visual Basic.
------------------
rino_2
Visual Basic, HTML
Searching Word Documents For Text
Yet another Word document question.
I'm looking for a way to emulate the windows search ability to look for documents containing specific text. Ideally the user would provide a term to search for, click a command button, corresponding documents would be listed, and the user could double click on a document to open it in Word. Only need to search Word documents and the search would be confined to two separate sub directories below the app, Download and Archive (no zip files).
Any help would be greatly appreciated.
Searching For Certain Word In Txt File
Hi,
My prog is reading the source code of a certain website, and saving it as a txt file.
Now i'm looking for a way to take a number out of that txt, and make a var out of it.
The website displays different information each day, and i need to substract that specific number into my program (daily).
Basicly all i need is for the code to search the text file, and return whatever is between <br><u><b> and </u></b><hr> or whatever is around it.
is this possible?
Complete Word Searching In File
i have text file that contains strings like this
"A big cat hunted a big animal"
i would like to give ant character in textbox as like i want to write "hunted"
first of all i will write h then u then n then so on till the last character d is reached.
when string is completed without space then it should give message
remember:= this is a 1 mb file i cannot use if or switch statement
Getting An Error When Searching For A Word In A File
HI Guys
I have this code that will search for a word "Exit" when it finds its The tool will exit, the file that its reading from its being updated by another tool, I want this tool to keep reading the file while its being updated: I am getting an error "Subscriber Out of Range"
Code:
Dim ff As Long
Dim sFile As String
Dim sText As String
Dim arLines() As String
Dim LastLine As String
Dim i As Long
ff = FreeFile
sFile = "c: est.log"
Open sFile For Input As #ff
sText = Input(LOF(1), #1)
arLines = Split(sText, vbNewLine)
Close #1
sText = ""
LastLine = arLines(LBound(arLines))
Debug.Print LastLine
Do Until arLines(i) = "Exit"
For i = UBound(arLines) To LBound(arLines) Step -1
Me.Show
Form1.List.AddItem arLines(i)
If InStr(arLines(i), "Exit") Then
End
End If
Next i
Loop
Any Suggetions?
Thanks
Searching Text File For A Group Of Text.
Does anyone know the most efficient way to search a text file for a group of lines? For example, if the file was:
d = xxxxxx
a = xxxxxx
b = xxxxxx
d = xxxxxx
c = xxxxxx
e = xxxxxx
b = xxxxxx
where xxxxxx is any set of numbers.
and you wanted to search for the block of strings:
b = xxxxxx
d = xxxxxx
c = xxxxxx
Is there a quick and efficient way beside reading each line, matching against the first line, checking if the line following it is the second line, etc?
TIA
Bishop
Searching Text File
Greetings!
I am struggling to search a group of files for a specific string. I have used the Application.FileSearch in Excel VBA but I do not know of the alternative file search methods available in VB.
Your suggestions guys?
Searching Text File
is there a way to open a file, search through each line for the first 5 char to find a certain string, and if it's there then get the data to the right of it and edit it then save it back to the same location?!?!
i have the searching part, but i have no idea how to get the row, or column(if thats possible) or anything
thanks
Searching A Text File
I am writing a small program to screen pop our ACT! Database from our CTI program, I have tried using a method that searches the database using the SDK tools but it is too slow.
Another utility creates a CSV from the database which is used for another purpose but the CSV contains the phone numbers and the unique ID of each record and with the Unique ID i can tap straight into the database very quickly.
The CSV File containing about 8000 lines each with 8 fields, I would like to search in the file for the appearance of the phone number and then use the contents of field 8(Unique ID) further in the program. The phone number could appear in multiple lines and i would like to have it display a choice between these records.
I Am a newbie coder so any help with methods of searching this CSV would be greatly appreciated. Search speed is the key feature i need.
Please Help
SkreeM
Searching A Text File.
I have a text file that has the following: name, ID, average, Grade. What i want to do is have the user input an id and i want it to search the file for the id and if it's found i want it to output all the information related to that id number. i have the code to open so all i need to do is search it. the id's are between 1000 and 2000 would i just do a loop that runs through those numbers and if it finds a match have it out put or what? i'm clueless here.
Searching Through A Text File
I would like to be able to extract certain data from a text file for my program and have no idea how to do it. I've searched through all my VB books but I'm still confused.
Here's the scenario.
The external txt file contains comma delimited data that would look something like this:
Amount,11000,Amount,5000,Amount,1000,Amount,11000
The real thing contains more data, but the above is more specific to my needs.
I would like to set it up where the user would click a button, the program would go through this file (located in the root of the c: drive) and add up all of those amounts. Then return the total to a txt box.
I know this is a bit much, but any ideas would help.
Thanks!
Searching Through A Text File
Hey, i want to create a program that searchs through numbers in a text file, its for a hockey manager game (EHM if you've heard of it). Basically i want the program to display the Players name as well as their Potential number and Consistency number. Both numbers are two digits and are among several thousand numbers in the file. This is to make it easier to look at whose good in the draft so there will need to be some sort of code that only displays players born in a certain span of years such as 1986 - 1988.
If anyone could help me it would be much appreciated.
Thanks in advance
Searching For Text In A File
Hi All,
Using fileSystemObject or any other tool, how can I programmatically search for a text/word in a file.
Example: If I've 100 files in a folder and I want to search for a word "ERROR" exist in those files. Instead of using the windows "search files and folders", I want to write a program that can do it.
Cheers
Searching Text In A File
Ok, I know I posted about this before, and all were good suggestions, but none helped with my problem.
I have this bit of code -
10.1.6.248, EPCUSD_#401username, -, Y, 12/16/01, 13:50:29, 1, -, -, www.aol.com, -, 80, 90, -, 820, http, -, -, http://www.aol.com/popups/script/non_popup_memEd.js, -, Inet, 10054, 8389635
What I want to do is if I enter the username I want the program to show me all the web pages the person has been to in a list box.
I have the part where it finds the username already, but I cant get the part where it pulls the http://ect...
Any Ideas
Searching Text File
Hi,
I have a text file that is the result of a SQL query. How would I run a search on it according to something that a user puts in 2 two boxes (First Name and Last Name)? I then want to show the results in either a seperate form or a message box...
Thank you
Searching For Value In A Text File
I am creating a program to save data to a sequential access file and I am able to write data to the file using multiple textboxes. When I save the data to the file, one line of
text constitutes one record.
How can I open that file and perform a search for a value, then when it is found, populate the corresponding textboxes?
Any help is much appreciated!
Searching A Text File
To whom may help..
I am trying to write a program that will open one file #1, for input, read one line at a time. Open a second file #2, search thru text of file #2 for the information from file #1. I would also like to know how to set a search start and a search end and collect all information in between.
Thanx
Searching Through Text File?
How do I seacrh a string through a text file and when the text is found, separate small strings separated by semicolon( and display them in different textboxex.
Any help will be appreciated.
Thanks in advance.
Kinjal
Searching A Text File.
how do you search a text file for a certain word and then delete it from that text file in vb 5?
------------------
Mooose
Searching A Text File.
how do you search a text file for a certain word and then delete it from that text file in vb 5?
------------------
Mooose
Searching A Text File...
I created a database to store records and had no problem returning query results. However, I was told that we can't use Access and that the records need to be stored in a semi-colon delimited text file.
I have no clue whatsoever how to write a search. This file holds over 260,000 records so speed is possibly going to be a problem.
The file format is (semi-colon used because of name Format with comma):
ID; Lastname, FirstName; Sex; Date of Birth; Mother's Name
Originally with the database I selected a field to search and ran the related query with the criteria pulled from a text box. Now I'm thinking that I just need a text box and run the search for matches from that single text box.
A piece of code to get me started would be lovely. Or... if you have links to any tutorials that would be great to.
Thanks,
Phil
Searching A Text File?
Hi.
I have a text file which in which the lines are numbered this way:
[flightsim.0]
[flightsim.1]
-
-
[Flightsim.43]
and so....
I want to append some text to the textfile and wants to find out what the
highest number is, i.e. 43 and then add 1 to this number for the text to be
appended.
How do i do that?
Kind regards
Frank
Searching The Text Of A .pdf File
Hi, I am creating a project that involves displaying .pdf files. I would like to be able to have the user type in a search parameter/keyword and then search through a directory of .pdf files to see if their keyword is contained in any of the documents. Thank you in advance for any light you could shed on this.
Searching Through A Text File
I am doing my a level visual basic project, and have a problem. My program is for a shoe shop, with a stock control system and a till system. I add the details of a shoe (barcode, name, price) into a text file from my stock control system, and in my till system i want to input a certain barcode, where it will search for this barcode in the saved text file until it finds the corresponding record, and as a result brings the corresponding name and price of the shoe onto the screen. How do i do this? Do i need to separate each individual variable (barcode, name, price) by a comma? because when i open the text file it is stored like so: "Slipper 49.99 34583248 Ross † 12365478" (These are two records, the "slipper" and "ross" are the names of the shoe, the 8 digit nos are the barcodes, and the other symbols are the price and quantity (?)) btw, i also need it to take one off the quantity each time i input the barcode (this is when a sale is made). Help would be much appreciated. Thanks, ross
Searching Through A Text File
Ok, I am making an AIM program and the only way I know how to check for their username/pw is that when they connect it checks a text file on my computer (the server) for there name, so in englis hthis is what i want it to do:
search "c:/names.txt" , "username"
if it finds it then it sends oktoconnect, basically search a text file for a string and tell me whether or not it found it, sorry for that unexplanatory question but im in a hurry (= thanks in advance.
Searching A Text File
How can I search through a text file to find words or phrases. I need to search a log file for errors.
Thanks for any help you can provide.
Dave
Searching A Text File.
Hello all,
am trying to have a list of about 60,000 words(.txt file) searched and the results/partial match displayed in a text box. It will be used as a spelling reference for specialty words. I know that a list or combo box would do what I am looking for but populating it with that many entries would be a nightmare. Any ideas as to how I could accomplish this? I have tried to populate a table with the text file in a VCE form but it crashes the PPC and requires a hard reset. Any help/direction would be appreciated.
Rod
Searching A Text File
Does anyone know how to programmatically open an existing text file. Then search through a comma delimited file(like the portion below) for a string, '475'.
16,301,13981439,Z,IA0010,012040/
16,301,4756071,Z,IA00045,000000/
16,475,72363175,Z,IA00025,012040/
16,475,42736600,Z,IA00025,012050/
Thank you
No L c
VB Developer
Searching Text In A File
Hi,
I want to search a text in all the files in a directry.Please tell me if there is any easy way to do that.
Thanks,
-arun
Searching A Text File
need help with source code for an application which will accept a string from a text box and then search a text file for a matching string and then display its contents. if there is no matching string then the next compatable result should be displayed. can anyone help ?
Reading/Searching Text File
I tried searching the boards for the answer to this, but all i could find is bits and pieces. All I need is some simple code on how to read from a text file, and how to search through a text file, then take the items its found, and place them into variables.
For example
I have a text file called text.txt. The contents of the text file are as follows:
One
Two Three
Four Five Six
Basically what would be the code to pick out the string "Four Five" from the text file and place it into a variable. It would need to search through the entire file, to see if there are several instances of "Four Five".
Im sure this has been answered several times, but I couldnt find it
Searching Record In Text File
hi guys,
everything in this bit of code is doing fine...
but my combobox gets all the record in textfile, all i want is only the first column of the record...
give me some hints...
please help me..........
Private Sub cmd_Click(Index As Integer)
Dim f As Integer
Dim findstr As String
f = FreeFile
Select Case Index
Case 0 '-----CmdAdd---------
Open "c:sample.txt" For Append As #f
Write #f, Text1(0).Text; Text1(1).Text; Text1(2).Text
Close #f
'Call clear
'-----------problem here------------
Case 1 '------CmdSearch------
Open "c:sample.txt" For Input As #f
Do While Not EOF(1)
Input #f, findstr
Combo1.AddItem findstr
Loop
Close #f
'Call clear
End Select
End Sub
tnx
Searching For String In Text File
I am stuck again. I've searched the forum the all that I can and I am still stuck.
I have a program setup so that all the strings in lstConsole writes to a text file. I was wondering if you can tell me if it is possible to search that text file for a specific string, and if that string is there do this
not code
If text.txt has string "i shot the sheriff" then
lstconsole = "but i did not shoot the deputy"
I will be grateful for any help you can give me, and if its not to much trouble please explain it to me like I'm a 5yo.
Searching A Text File For A String
Hi,
What is the quickest way to find out if a text file contains a specified string?
I have a program that adds a string into HTML files. I do not want to add the string if it already exists in the file. I am processing upto 50 files at a go. (I am reading the file line by line until I find the right spot for the string.) Is it possible to read in the whole file in one go into one string and then do an instr command?...or something.
Thanks for any advice.
Searching And Modifying A Text File
OK, this is a pretty basic thing, and if search was working, I would probably find the answer in there. So bear with me, I know this has probably been covered a million times.
I'm writing a program that reads a text file, which is basically a bunch of records, displays them, allows the user to edit them, and saves the changes back in the file. (Obviously, this thing would be accomplished so much better with a database, especially since we're looking at uber files on the order of 1+ MB. But the file is already in text format so that's what I have to work with.)
So, my question is, I haven't done file handling in quite a while, and I'm not sure what the best way to go is. I was thinking about using the FileSystemObject to find and manipulate the file, then I thought about using the Word ojects, since it has find capabilities built in. I'm not that familiar with either of these objects, so I don't really know if one is better than the other, or if there's a better solution. If anyone can give me some tips, or point me to some info, I'd appreciate it.
Thanks.
Searching A Text File For For A Match
I have a form to disarm a security system I am building. On cmdDisarm_Click I want to check txtPassword for a match of a password in a .dat file. As I am new to VB I would greatly accept your help...
Roger
Help With Searching A Text File Using Wildcards
Firstly, im a newbie at coding.
secondly can a search be done on an opened text file using wildcards and then printing the result of the search to a text box?
e.g. i want to search for '*' (star being the wildcard and showing only whats between the appostrophies) then printing the result to a text box. i have used:
open "c:file1.text" for input as #1
but dont know how to actually perform the search.
hope this is clear and hope i get a quick reply.
thank you for your time in advance.
Searching And Writing To A Text File
I am using Access to manage a multi-format, multi-language web site. I need to write information from two different tables to a single text file. Because of the work I have already done, and to avoid creating any new tables, the easiest thing to do would be to run my first macro, which would write to the text file and leave a marker (which could be anything that would be easy to find, I figured a comment which would be invisible to the browser). I then want to create a second macro which would open the text file, locate the marker, and replace it with data from the second table.
Is it possible to do this?
Thanks!
Reading And Searching A Text File
Here is a snipet of a log file I need to parse for license usage:
13:35:00 IN: "application" user1@computer1
13:35:22 IN: "application" user2@computer2
13:38:37 OUT: "application" user1@computer1
13:35:00 OUT: "application" user2@computer2
This log file has when a computer check out a license and when it return it. So for each computer I would like to calcute how long it used the license.
I would greatly appriciate any help you can provide to get me started. I know how to read a line and parse the data I need from it, but this goes way beyond that.
Thanks
dmathieu
Searching In A Large Text File
Hello, I'd like to search for movie names in a large text file and return the matches. I know how to do it with predefined words, but what I'd like to do now is more complicated.
This is the code I normally use with predefined words.
Code:
Private Sub Command1_Click()
Dim sLines As String
Open "C:movielist.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, sLines
If InStr(1, sLines, "matrix") And InStr(1, sLines, "revolutions") Then
Text1.Text = Text1.Text & sLines & vbCrLf
End If
DoEvents
Loop
Close #1
End Sub
Now I have this in a textbox:
Code:
!search matrix revolutions final end
If "!search" is in the textbox, then the other words (excluding "!search") need to be used as search strings, but only if they are at least 4 characters. In this case "matrix", "revolutions" and "final".
I know I can find out if "!search" is in the textbox with the Left function and that I have to put the words in an array, but how do I only add the words with at least 4 characters to the array and how do I use the array to search in the text file?
Code:
Private Sub Command2_Click()
Dim strArray() As String
If Left(Text2.Text, 8) = "!search " Then
strArray = Split(Text2.Text, " ")
End If
End Sub
Searching Text In Hindi File.
Hello friends ,
I am doing M.Phil (Hindi) . My project is to develop google search in hindi . I have good knowledge in computers and c and c++ languages and a little knowledge in VB.
My question is
How can I search a hindi word in hindi text file ? Suppose there is a word LADAKA in hindi if in the file it is in the form of LADAKE then how can I can recongnise because in programming we can not type hindi font to compare . I know upto how Can we find a word but if it is exactly in that form then only it is possible.
So ,please give me programe in C or Vb.
FILE HANDLING & SEARCHING TEXT
I just want to know how to search a particular text from a group of files in a directory and then change the
search text to another text. Could you send me a detailed coding regarding this.
Thanks in Advance.
Krish.
|