Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Separate text files and convert into csv
Post: RE: Separate text files and convert into csv

Thank you all for your comments and time. In my case it works well output.writerow([(txt_file), line.replace ('\n', ' ')])as suggested by BashBedlam. I also decided to remove punctuation in my text fi...
marfer General Coding Help 6 2,880 Dec-10-2021, 12:09 PM
    Thread: Separate text files and convert into csv
Post: Separate text files and convert into csv

I have several text files in a folder that I want to split by paragraph and convert into csv. Each text file is composed of several paragraphs and some paragraphs have several lines. Paragraphs are se...
marfer General Coding Help 6 2,880 Dec-09-2021, 07:00 PM
    Thread: replace exact word
Post: replace exact word

Dear Python users, I am trying to replace substrings in a pandas column with the respective exact substring. Imagine that I have the following text: text = "I loves us. lovess" and I would like to obt...
marfer General Coding Help 1 6,175 Oct-11-2021, 05:22 PM
    Thread: fuzzywuzzy search string in text file
Post: RE: fuzzywuzzy search string in text file

And if I search "john smith", he only searches for "john". Thank you for your comments and support. I think I will be able to obtain what I want using regular expressions and your code for fuzzywuzzy....
marfer General Coding Help 9 4,586 Aug-02-2021, 09:22 PM
    Thread: fuzzywuzzy search string in text file
Post: RE: fuzzywuzzy search string in text file

Thank you, deanhystad for your code and explaining me why my code was not working. Your code works well and from your code I also understood how to report the files with a match score better than some...
marfer General Coding Help 9 4,586 Aug-02-2021, 06:21 PM
    Thread: fuzzywuzzy search string in text file
Post: RE: fuzzywuzzy search string in text file

I was doing for file in os.listdir('C:/Users/mydirectory'): with open('C:/Users/mydirectory/'+file) as f: for num,line in enumerate(f): if process.extractOne("john", line, scor...
marfer General Coding Help 9 4,586 Aug-02-2021, 04:50 PM
    Thread: fuzzywuzzy search string in text file
Post: RE: fuzzywuzzy search string in text file

deanhystad, thank you for your comment, but I still was not able to understand how to obtain the best match. I also tried: process.extractOne("john", line, scorer=fuzz.token_set_ratio)but python only ...
marfer General Coding Help 9 4,586 Aug-02-2021, 04:04 PM
    Thread: fuzzywuzzy search string in text file
Post: fuzzywuzzy search string in text file

I have several text files in a folder and I would like to find a file by searching for a specific string. I started by using regular expressions: import os, re for file in os.listdir('C:/Users/mydirec...
marfer General Coding Help 9 4,586 Aug-02-2021, 01:50 PM

User Panel Messages

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