[QUOTE]I would like to search for more than one word in a text file and if the word found i would like to save it to a group in which i have files belonging to English,Entertainment etc.The thing is Im unable to search for more than one string in a file.I wrote few lines of code.Can any one please tell me the correct procedure to classify text files.[/QUOTE] [CODE] import shutil fp=open("net.txt","r") #opening a file for searching text=fp.read() fp.close() search="sandhya" #searching for the term sandhya index=text.find(search) print((search), "found at index", index) print("name file") #telling to which group this input file …

Member Avatar
Member Avatar
+0 forum 4

Hello so hopefuly someone can help me but i cant seem to find the error and my teacher is in Flordia for the next week so i dont have him to ak for help. So my project was to read input from 11 .cpd files one at a time and then do some simple test on them. These test where to find the average count of: i's, me's, he's, she's, it's, we's, them's, and's, but's, or's, nor's, a's, an's, the's, and proper names. The Number of: alliterations, and Sentances that start with the same word. I belive i know where …

Member Avatar
Member Avatar
+0 forum 3

Hi folks, I've a problem when writing the contents of a file that was read using steam reader to the console window. It is only displaying part of the information that it should be showing. It should be displaying like this: http://i1370.photobucket.com/albums/ag266/Aaron_McCauley/1_zps4b8c3625.png But insted it displays like so (Notice the cursor jumps ahead about 5 lines): http://i1370.photobucket.com/albums/ag266/Aaron_McCauley/2_zps7f0e6259.png Anyone no of a fix? Heres the code of the method: //Searching by Town static void FindTown(CustomerStruct[] CustomerDeats) { string City; bool CityMatch = false; Console.Clear(); begin: try { Console.WriteLine("Please enter the customers Town "); City = Console.ReadLine(); } catch { Console.WriteLine("Failed. Please …

Member Avatar
Member Avatar
+0 forum 4

Once upon a time, I read somewhere in a book (whose name escapes me) that to PROPERLY validate an email address, the regex was somewhere in the neighborhood of 200 lines of code. (It probably has something to do with all the country domains.) That number has probably gone up since then. I passed that bit of trivia to a fellow coder, but realized I couldn't source it. It's probably locked away in a Perl function somewhere, but I don't know Perl nor the Perl community. (Or that could be a red herring). In any case, does anyone here have …

Member Avatar
Member Avatar
+0 forum 3

Hi, im using visual studio 2010, and for my recent assignment i am having difficulty when closing a text file. My program is to read in the data from a text file and then do some calculations and then output the result. My text file Measurements.txt looks like this: 5 11 4 3 6 7 4 2 Each set of 4 numbers represents miles, yards, feet, and inches. For example, 5 miles, 11 yards, 4 feet, and 3 inches are the first four, then the second four is the second set of data. My problem is that when i try …

Member Avatar
Member Avatar
+0 forum 1

The End.