From stephen.marquar d@uct.ac.za Sat Jan 5 09:14:16 2008
Return-Path: <postmaster@col lab.sakaiprojec t.org>
Received: from murder (mail.umich.edu [141.211.14.90])
by frankenstein.ma il.umich.edu (Cyrus v2.3.8) with LMTPA;
Sat, 05 Jan 2008 09:14:16 -0500
X-Sieve: CMU Sieve 2.3
Received: from murder ([unix socket])
by mail.umich.edu (Cyrus v2.2.12) with LMTPA;
Sat, 05 Jan 2008 09:14:16...
User Profile
Collapse
-
word frequency
I'm trying to print email address and each of their frequency on it's right by reading a text file. The counting part is correct but it prints other things as well. I'm not sure how to solve this. Hope someone could enlighten me. Thank you very much.
...Code:import string fname = raw_input("Enter a file name: ") if len(fname) == 0 : print "Assuming mbox-short.txt" fname = "mbox-short.txt" -
Thank you so much!! :) I'm just a beginner, so I don't know the library sys yet. But it helps! Thank you!...Leave a comment:
-
Search for a word from a text file and count
I need to search through the file and look for lines that begin with "From". I need to parse the From line and print out the second word for each From line and then also count the number of From lines and print out a count at the end. I'm not sure what to do. Any help is appreciated.
...Code:import string fname = raw_input("Enter a file name: ") try: infile = open(fname, "r")
No activity results to display
Show More
Leave a comment: