Python Forum
Extract Strings From Text File - Out Put Results to Individual Files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract Strings From Text File - Out Put Results to Individual Files
#7
You are still checking every word for every word. You loop through pear and cherry. The first loop is for pear. And in that loop you check for both pear and cherry. The second loop is for cherry, and in that loop you check for both pear and cherry again. You need to change your if statement to be like Sudhakar's, so it only checks the word for the current loop.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Extract Strings From Text File - Out Put Results to Individual Files - by ichabod801 - Jun-27-2018, 08:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 1,236 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  Extract and rename a file from an Archive tester_V 4 4,271 Jul-08-2024, 07:54 AM
Last Post: tester_V
  Extract text from PDF goryee 2 9,909 Jul-08-2024, 06:35 AM
Last Post: Pedroski55
  Is it possible to extract 1 or 2 bits of data from MS project files? cubangt 8 4,243 Feb-16-2024, 12:02 AM
Last Post: deanhystad
  Updating sharepoint excel file odd results cubangt 1 2,222 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  Trying to understand strings and lists of strings Konstantin23 2 1,938 Aug-06-2023, 11:42 AM
Last Post: deanhystad
Question Need help for a python script to extract information from a list of files lephunghien 6 2,808 Jun-12-2023, 05:40 PM
Last Post: snippsat
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 4,618 Jan-23-2023, 04:56 AM
Last Post: deanhystad
  azure TTS from text files to mp3s mutantGOD 2 3,431 Jan-17-2023, 03:20 AM
Last Post: mutantGOD
  Trying to send file to printer with no results. chob_thomas 2 6,250 Dec-21-2022, 07:12 AM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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