Skip to content
Advertisement

Tag: find

Find and replace no updating values

I’m writing a script that combine csv into one and then do a find an replace for specific formatting and ask the user to correct the ones that not match. The output is not on the right csv format It should be Answer This problems has a number of different parts, and you’ve made a good attempt :) I recommend

Find Function in Python

I’ve made this code but it is not acting how I was expecting: Basically I read a .pcap file which can be full of information or empty and I’m looking for a word inside each raw. If it is found I start some operation on this string in order to reach a desidered position inside the string. I noticed that

python substrn cells in a column dataframe

I have this data frame with this kind of column: I need to clean this up and leave from “DCG_” up to where “</div>” begins: Most of the cells in this column vary where the “DCG_” is located as well as the “</div>”, I’m trying to use the following code line for this: but it just returns all null Answer

Python-docx: Find and replace all placeholder numbers in Word doc with random numbers

I’m having trouble finding and replacing all occurrences of several placeholders within paragraphs of a Word file. It’s for a gamebook, so I’m trying to sub random entry numbers for the placeholders used while drafting the book. All placeholders begin with “#” (e.g. #1-5, #22-1, etc.). Set numbers, like the first entry (which will always be “1”), don’t have the

PyCharm 2021.1 “Find in Files” not working

Ever since I installed update to PyCharm 2021.1 my find usages and find in files features always return nothing found. Is there some settings that I’m missing that I suppose to set in this new version? Answer The answer is on Jetbrains’s issue tracker here: issue IDEA-266391. WORKAROUND Invoke File|Invalidate caches and select the following checkbox: Find in files doesn’t

How to find a link in a big string

I want to find a link like https://stackoverflow.com/questions/37543724/python-regex-for-finding-all-words-in-a-string in a big string but there are many links and I want all links that starts with https://stackoverflow.com/questions/ the string look like something https://stackoverflow.com/questions/37543724/python-regex-for-finding-all-words-in-a-string something So my question is how can i find an uncompletet string? Answer Try this: This outputs: [‘stackoverflow.com/questions/26325943/many-threads-to-write-log-file-at-same-time-in-python’], which is what I assume you want.

Finding the number of rows for all files within a folder

Hello I am trying to find the number of rows for all files within a folder. I am trying to do this for a folder that contains only “.txt” files and for a folder that contains .”csv” files. I know that the way to get the number of rows for a SINGLE “.txt” file is something like this: Whereas for

Advertisement