Help: How to Search a text file for a string
-
I need some help on how to Search a text file for a string that is in a text file. This will be used in a Applet. Their will be a text box and when you enter a word ex("adam") and press search it will read the text file to see is adam is a valid entry. If it is a valid entry it will return true to a text area if not true it will return false to the text area. Any help would be great.
-
I need some help on how to Search a text file for a string that is in a text file. This will be used in a Applet. Their will be a text box and when you enter a word ex("adam") and press search it will read the text file to see is adam is a valid entry. If it is a valid entry it will return true to a text area if not true it will return false to the text area. Any help would be great.
Hi, There may be many methods to do that.. but i'll tell you a ral simple one.. Just open the text file you want to search in... and then traverse throughout the file and do a character by character comparison with the string Regards Sameer
-
I need some help on how to Search a text file for a string that is in a text file. This will be used in a Applet. Their will be a text box and when you enter a word ex("adam") and press search it will read the text file to see is adam is a valid entry. If it is a valid entry it will return true to a text area if not true it will return false to the text area. Any help would be great.
If you're using it in an Applet, does that imply Java (forgive the ignorance of the question, I'm not a Java guy)? In any event, I'd explore the String classes that are available. They typically have fairly robust text searching / comparision features. No point reinventing the wheel... Chistopher Duncan Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)