Python Forum
searching file for unique words
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
searching file for unique words
#1
I am a new programmer looking to write a program that will search a .txt file and print out the unique words in it. Are there any built in functions that can help with this?
Reply
#2
I'd say open(), split(), set()
Reply
#3
(Nov-20-2018, 05:04 PM)Gribouillis Wrote: I'd say open(), split(), set()

strip(string.puctuations)
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  splitting file into multiple files by searching for string AlphaInc 2 815 Jul-01-2023, 10:35 PM
Last Post: Pedroski55
  Extract a string between 2 words from a text file OscarBoots 2 1,827 Nov-02-2021, 08:50 AM
Last Post: ibreeden
  Generate a string of words for multiple lists of words in txt files in order. AnicraftPlayz 2 2,758 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  help with project of reading and searching big log file korenron 6 2,123 Jun-24-2021, 01:57 PM
Last Post: korenron
  Counting the most relevant words in a text file caiomartins 2 2,446 Sep-21-2020, 08:39 AM
Last Post: caiomartins
  Searching string in file and save next line dani8586 2 2,248 Jul-10-2020, 09:03 AM
Last Post: dani8586
  Trying to get unique words from a set of strings garam0 5 5,042 Apr-15-2020, 06:24 PM
Last Post: garam0
  Replace words in a file bitwo 3 2,380 Jan-22-2020, 04:05 PM
Last Post: bitwo
  How do you replace a word after a match from a list of words in each line of a file? vijju56 1 3,415 Oct-17-2019, 03:04 PM
Last Post: baquerik
  Counting words in the last line of a file Drone4four 15 6,381 May-31-2019, 09:30 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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