Python Forum
iterating through all files from a folder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iterating through all files from a folder
#1
I need to write a Python program that iterates through all the data files in a folder and calculates the total number of occurrences of a given name. For example, the user would input a name, Bob, and the program has to open the folder that contains 100+ text files that contain a list of names and count every occurrence of the name 'Bob' and print the final result.

How do you work with folders in Python (I'm on a Mac)?
Reply


Messages In This Thread
iterating through all files from a folder - by gonzo620 - Oct-29-2018, 08:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question How can I create a linked list that contains each folder with its files? noahverner1995 8 2,523 Dec-25-2021, 10:46 PM
Last Post: noahverner1995
  iterating through a number of files gonzo620 6 3,337 Nov-26-2018, 10:02 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020