text-processing

Pull a value from a text file to use as a comparitor

Pull a value from a text file to use as a comparitor Question: I need the pull the temperature from a text file, and then use the value as a comparitor to run one or the other python script. the data looks like this: time=14:10 temp=22.4 <—– I need this value tempTL=18.7 tempTH=29.9 intemp=66.4 I …

Total answers: 1

How can I remove arabic words from turkish string with regex?

How can I remove arabic words from turkish string with regex? Question: I want to remove all arabic words from my string. How can I remove arabic words with regex in python? **Input** = " Bugün hava صباح الخير çok صباح الخير güzel" **Output** = "Bugün hava çok güzel" Thanks for help Asked By: Saturn …

Total answers: 1

Python re.findall regex and text processing

Python re.findall regex and text processing Question: I’m looking to find and modify some sql syntax around the convert function. I want basically any convert(A,B) or CONVERT(A,B) in all my files to be selected and converted to B::A. So far I tried selecting them with re.findall(r"bconvertb(.*?,.*)", l, re.IGNORECASE) But it’s only returning a small selection …

Total answers: 4

tensorflow2.x keras Embedding layer process tf.dataset error

tensorflow2.x keras Embedding layer process tf.dataset error Question: This question is a follow-up of tensorflow 2 TextVectorization process tensor and dataset error I would like to make do a word embedding for the processed text with tnesorflow 2.8 on Jupyter. def standardize(input_data): input_data = tf.strings.lower(input_data) input_data = tf.strings.regex_replace(input_data, f"[{re.escape(string.punctuation)}]", " ") return input_data # the …

Total answers: 2

How could I remove newlines from all quoted pieces of text in a file?

How could I remove newlines from all quoted pieces of text in a file? Question: I have exported a CSV file from a database. Certain fields are longer text chunks, and can contain newlines. What would be the simplest way of removing only newlines from this file that are inside double quotes, but preserving all …

Total answers: 5

summarize text or simplify text

What are the available tools to summarize or simplify text? Question: Is there any library, preferably in python but at least open source, that can summarize and or simplify natural-language text? Asked By: captainandcoke || Source Answers: I’m not sure if there is currently any libraries that do this, as text summarization, or at least …

Total answers: 7

Python: How to loop through blocks of lines

How can I loop through blocks of lines in a file? Question: I have a text file that looks like this, with blocks of lines separated by blank lines: ID: 1 Name: X FamilyN: Y Age: 20 ID: 2 Name: H FamilyN: F Age: 23 ID: 3 Name: S FamilyN: Y Age: 13 ID: 4 …

Total answers: 10

How to delete all blank lines in the file with the help of python?

How to delete all blank lines in the file with the help of python? Question: For example, we have some file like that: first line second line third line And in result we have to get: first line second line third line Use ONLY python Asked By: user285070 || Source Answers: >>> s = “””first …

Total answers: 9