Category "replace"

Issues with replacing/updating files in tableau

enter image description here I'm a new tableau user, so please bear with me as I try to formulate my question. I just ran my 1st set of monthly reports this wee

How to replace double spaces with one space in filenames (also subdirectories) (CloudLinux Server release 6.10)

I want to replace double spaces with one space in the filenames of a lot of photos. These photos are located in directory /foto and it's subfolders. How to do t

How to replace a number in a string in Python?

I need to search a string and check if it contains numbers in its name. If it does, I want to replace it with nothing. I've started doing something like this bu

Python: remove single quotation in a string in a list

I have a list of items, list1, shown below: ["None", "A ','B", "A"] The second element of list1 is "A ','B". How can I remove the single quotation mark and

How to replace a character of a string if it is in a list in Python?

I need to check if there are any of the characters of a list of characters in a string and replace it with another character. e.g. characters = [" ", "-", "@"]

PHP each() function replacement

I read a textbook and it said each() function is deprecated. The author has recommend his own replacement for each() function called myEach() as following: func

How to search and replace text in an XML file using Python?

How do I search an entire xml file for a specific text pattern and then replace each occurrence of that text with new text pattern in Python 3.5? Everything

search and replace with regex to increment numbers in Visual Studio Code

I'm currently working on a big svg sprite. The diffrent images are always 2000px apart. What I have is: <g transform="translate(0,0)"> <g transform="

regex remove line breaks between double quotes without affecting other line break (eager match)

I have a map (key, value pairs) and few of these values have line breaks within them (inside double quotes) which is causing issues in CSS. How can I remove the

Strict regex in Pandas replace

I need to write a strict regular expression to replace certain values in my pandas dataframe. This is an issue that was raised after solving the question that I

Why are some characters ignored when calling LastIndexOf?

Please take a look at these codes : string str_to_find = "➖➖➖➖➖➖➖➖➖➖\r\n"; string str

How to replace pandas dataframe column names with another list or dictionary matching

I need to replace column names of a pandas DataFrame having names like 'real_tag' and rename them like 'Descripcion' list = [{'real_tag': 'FA0:4AIS0007', 'Descr

How to Replace text in the output from a Batch Script

I have a script I run and this is a sample output: OK J: \\har-fs01\dept OK K: \\erl-tbafs01.tbamerica.com\share OK

finding and replacing elements in a multidimensional list (python)

Similar to this question: finding and replacing elements in a list (python) but with a multi-dimensional array. For example, I want to replace all the N's with

Efficient way to edit the last line of a text file in Python

I have a Python script which creates a large SQL insert file of about 300,000 lines. The problem with this is that the last line of the file ends up looking lik

Replace a name in a string in Python

I'm working on a assignment and I need to replace Alice with my name. Here is the program, for i in range(10): print(i) print(split_alice[i]).replace_a

VS Code Extension API - Replace a String in the document?

const textEditor = vscode.window.activeTextEditor; if (!textEditor) { return; // No open text editor } for(var i=

How do i replace [] brackets using SED

I have a string that i am want to remove punctuation from. I started with sed 's/[[:punct:]]/ /g' But i had problems on HP-UX not liking that all the time

IntelliJ replace variable names in multiple lines

I am wondering is there a shortcut that can replace a variable name with a new name on multiple lines in the current Java file for IntelliJ. Is it just simply d

How to replace first occurrence of string in Java

I want to replace first occurrence of String in the following. String test = "see Comments, this is for some test, help us" **If test contains the input as