Questions tagged [replace]

Replacing is the action of searching a string for a sub-string and replacing it with a different string.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Replace that kind of list in a dataframe pandas

I have a column named categories in a dataframe that contains that kind of values : [['Electronics', 'Computers & Accessories', 'Laptop & Netbook Computer Accessories', 'Batteries']] ...
MichaelSeven's user avatar
-1 votes
0 answers
27 views

Regex assistance in R

I am trying to manipulate the following sting x = log(y(-1)) So that I can replace the (-1) with dplyr::lag(y) I'm hoping my output to look like this x = log(dplyr::lag(y)) The strings I will be ...
Adam_123's user avatar
  • 149
0 votes
0 answers
11 views

Retirar uma palavra e as aspas de um string : exemplo quero remover a a primeira palavra e manter a segunda ex: "ovo": ovo.com.br [closed]

string ovo = ""ovo":ovo.com.br"; ovo.Remove('"ovo"'); ovo.Replace(',', ' ' ).Replace(':',' ').Replace('}',' ').Replace('"',' '); sei que normalmente um string nao ...
Rendrix Dias's user avatar
-3 votes
0 answers
32 views

SQL REPLACE String without ERROR and Effect [closed]

I want to change a path in a table. UPDATE data SET path = REPLACE(path, 'V:\01 ind', 'https://apps/lib') WHERE path LIKE 'V:\01 ind%' The command goes through with success, but affects zero entries. ...
blaert's user avatar
  • 1
0 votes
2 answers
44 views

Placeholder string replacement that's user input safe

I need functionality to "dehydrate" some user input, replacing it with placeholders, with the ultimate goal to "rehydrate" it elsewhere. For example: Visit [my page](http://example....
quantumSoup's user avatar
  • 27.1k
-1 votes
3 answers
47 views

Replacing random characters in string [closed]

I have a random string word for example word = graphic I want to take this word and and turn any random letters into underscore and put space in between for the output to look something like this g _ ...
user12128587's user avatar
0 votes
0 answers
26 views

Read an excel file in the C# console

I need to read an Excel file, I did everything according to the video tutorial and there are no differences in the code, but when I run the code, the line is not executed: excelTable[rowIndex - 1, i] =...
illuha's user avatar
  • 7
0 votes
0 answers
5 views

Android How to Decode quoted-printable string

I can't find any type of method to decode quoted-printable text into string. If I have a message like this: =20 =20 =20 =20 Google Cloud Platform & APIs =C8 ...
DoctorWho's user avatar
  • 992
0 votes
0 answers
39 views

Excel SUBSTITUTE replacing both exact and contains word as well

how to replace the word only if exact match found in a paragraph LAMBDA is not supporting in our system, any solution for it =TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(...
Saravanan Baskar's user avatar
2 votes
1 answer
28 views

How to find string that startswith and replaces

I have a file where I need to search for string and replace, difficulty is the string changes as pre-requisite which I'm struggling to get the code working. Text file: This is a Test file TEST001. In ...
user29496's user avatar
  • 177
0 votes
0 answers
23 views

Remove square brackets in pandas [duplicate]

We have a column in pandas in the form of rows in which there are lists: In: df[column].iloc[0] Out: "[' 1 ', ' 2 ', ' 3 ', ' 4 ']" How can I remove the square brackets and rewrite the ...
Денис Афанасьев's user avatar
0 votes
6 answers
43 views

Replacing values in pandas dataframe with multiple conditions

I want to create a new column that does a mapping. For example if col1 only contains Ted values then i want to make the mapping Ted, if it contains both Ted and Not Ted i want to make the mapping Both,...
Eisen's user avatar
  • 1,685
-1 votes
1 answer
59 views

How to replace a word in a string using Java

Suppose I have the string "John is distinguished" and I wish to replace "is" with "FOO". When I use the replace methods, Java returns this string "John FOO ...
WilliamG's user avatar
0 votes
1 answer
28 views

PostgreSQL ISNULL transform null to minimum value of datatype

I have a PostgreSQL database and I have a complex query which is generated dynamically from C#. I need to use the ISNULL built-in function which in PostgreSQL is called COALESCE by replacing with ...
Stavros Koureas's user avatar
0 votes
0 answers
8 views

react.tsx project: replace method is working but returning an error: "TypeError: apiValue.replace is not a function"

The code is generating an error (apiValue.replace is not a function") but if you close the error massage the code works, and to be sure I logged the variables and the valueof the variables I'm ...
Mahmoud Alaissami's user avatar
0 votes
2 answers
43 views

how to use R gsub function to remove punctuation and number?

I have a column contain and I wanted to remove the (*) at the end of the string but some has space in between and some has not: Variable 0. No (1) 1. Yes(2) 2. Refuse to Answer (3) 3. Agree(4) 4. ...
Peter Chung's user avatar
0 votes
0 answers
17 views

Google IoT Core Replacement

I need help finding the best replacement for Google IoT Core which will be retiring on 16 August. We have 38 devices connected to Google IoT core. We would like to know which service is provided at a ...
AAALearning's user avatar
1 vote
2 answers
36 views

sed not working on large files. Any suggestions on different ways or syntax changes for replacing strings

Trying to insert a line feed on large files in UNIX when a text string matches. Any file around 1GB or less, it works. Anything over that size, it does not complete the replace. It appears to do ...
TimBurke's user avatar
0 votes
0 answers
14 views

Replacing 'unit' with 'pcs' in a sentence while keeping 'unity' unchanged in PHP

I want to ask besides using str_replace what should I use to replace? I have code : echo str_replace("Unit", "pcs", "Unity Scoop Neck Cap Sleeve Tee") The output results ...
nadia's user avatar
  • 1
1 vote
1 answer
63 views

Replace multiple patterns by start and end index in R

mystring <- c("code IS (384333)\n AND parse = TURE \n ) \n \n code IS (43343344)\n ) some information here code IS (23423422) ) and more information") I ...
Adrian's user avatar
  • 9,337
0 votes
4 answers
49 views

Replace in nested JSON string value '\\n' with '\n'

I have nested JSON and in some string value as part of the string \\n. I need to replace it with \n and return the object. My brain is washed, cos I'm trying it for the whole day and can't see the ...
user21955191's user avatar
0 votes
0 answers
20 views

Redshift - how to replace multiple values in string with result of listagg

I have a table called 'packages' that looks like this: | id | route | arrival_datetime | node | type | | -- | ---------------- | ---------------------- | ---- | ----- | | 2 | 1-&...
SV125's user avatar
  • 263
1 vote
1 answer
42 views

How does one update a file by line number in powershell?

all, I am trying to update a line in config file with powershell and I can't seem get it working properly... I have this file: config.ini version.clients.latest.location=.\ version.clients.latest....
Mr. E's user avatar
  • 415
0 votes
1 answer
37 views

Removing unwanted special (`*`, `"` etc.) and HTML (`<a8>` etc.) characters in R

I'm getting the responses to a survey (which is a data.frame) but the responses included several unwanted special (*, " etc.) and HTML (<a8> etc.) characters such as the one show below. I ...
Simon Harmel's user avatar
0 votes
0 answers
7 views

Replacing 'Multiple' with different values in multiple columns with VBA macro in Excel

I have the text "Multiple" in various cells in my sheet. I would like to replace the word Multiple with another word. But, the word I'm replacing Multiple with is different for each cell. I ...
Shana Faraghat's user avatar
1 vote
1 answer
32 views

How to replace level 2 in a multiIndex dataframe with values from a regular dataframe?

I am writing an algorithm for processing customers at work for some data analysis, and I am grouping the data by user ID as my level 1, then by month for my level 2. I am then doing some processing ...
Adalast's user avatar
  • 141
0 votes
1 answer
41 views

How do I avoid the replacement of the '^?' character during a search and replace operation in Microsoft Word?

Recently, I found that the search and replace function in Microsoft Word is very convenient. I would like to ask you to suggest a manual. As well as solving a specific situation. In the search bar, I ...
OlgerdOrikj's user avatar
1 vote
1 answer
40 views

Strange behavior of str_replace

I have a user-settable text, where the default one is [Log in] or [register] to view the content. What I need, is to wrap the two words in square brackets in their respective links. But first, I need ...
Faye D.'s user avatar
  • 799
0 votes
3 answers
38 views

I am trying to replace certain characters with an empty space in javascript

I am writing a javascript function that replaces certain letters in a string. It must only replace the first instance of the letter for example software engineering is fun must become sftwr engneering ...
Jaden's user avatar
  • 5
0 votes
1 answer
62 views

How to fix error with removing all instances in a string c++

I am having a problem with removing all instances of "amp;" in a string in c++, I have created a loop to replace "amp;" with "" until there are no "amp;" ...
EthanSteel's user avatar
0 votes
1 answer
64 views

Issues in Logic app while passing JSON variable

Requirement : I am trying to run SSAS tabular solution partition run based on tables and partitions through ADF and Logic App. I have created one table with list of dimensions and fact tables present ...
user21984731's user avatar
0 votes
1 answer
24 views

How can I return Wordpress content with generated ID's based on the number of H2 tags

What I'm trying to do it make a code where all H2 tags from the_content are pulled and read out to create a table of content. I've done this succesfully with the code below: function ...
branco holtslag's user avatar
1 vote
2 answers
33 views

Replacing space after number with hard space in p tag

I would like to replace a space after a number with hard-space " " only in p tags. I wrote this code: $pattern = "/<p>[0-9] <\/p>/"; return preg_replace($pattern, ...
Josef Kuchař's user avatar
0 votes
0 answers
29 views

Including anchor tag validation in HTML Validation logic

I've written a piece of code for my system that checks whether or not a string has proper opening ("<") and closed (">") brackets for any HTML tag. For example, if the string ...
flarow432's user avatar
0 votes
1 answer
42 views

Replace characters in filenames with new characters

I am trying to batch rename files to replace hard brackets [] in filename with soft brackets (). All files have the form series[sxxexx]title.mp4 Plex will not load files with [] so I need to replace; *...
Drew Pierce's user avatar
-2 votes
3 answers
72 views

How to replace strings in brackets with <span> tags in MySQL

I have thousands of string in a MySQL table in a column called query of type varchar(4096) which look always similar to the following one. The brackets are not always the same number! That means that ...
STORM's user avatar
  • 4,005
0 votes
2 answers
67 views

Ruby string replace without capture group

Ruby's String.sub(pat, txt) family of functions performs substitution and supports capturing groups in txt even if pat is a plain string (at least it seems to support \0 to print all of pat in the ...
elbrunovsky's user avatar
0 votes
0 answers
19 views

How can I replace null values in a DataFrame using values from other rows [duplicate]

Python: Replacing Values using other rows data Please assist, I have this form of data. I want to do replacement such that null values in 'Value1' column are duplicated as long the rows have the same ...
user3087182's user avatar
1 vote
2 answers
66 views

Find and replace using regex and a single input [closed]

I am trying to do a simple word changer. For this using a textarea, text and button. I will paste text in the textarea, for example type /red/g,'green' to textbox and click the button but something ...
Deniz Unal's user avatar
0 votes
1 answer
34 views

Mysql insert if different else update [duplicate]

How to add multiple records skipping duplicate values but to keep tracking value starting timestamp and last timestamp of value. Explanation why: I have sensor reading values every minute. If value ...
eSlavko's user avatar
  • 328
0 votes
0 answers
6 views

Replace a character from cells used in UDF

thanks all for assisting in my last code. Moving on from this, I need this logaveraging user defined function to not freak out when an asterix ("*") is in a cell that usually contains a ...
henz's user avatar
  • 1
0 votes
1 answer
32 views

Find and Replace date in multiple files inside multiple folders

I am looking to find and replace date across multiple files inside multiple folders. I tried recording using Notepad++ macro but cannot see any option to choose the date to be replaced while running ...
user4021949's user avatar
1 vote
2 answers
77 views

Add "e" after specified consonants if not already followed by a vowel

I am trying to use str_replace() to replace consonants which are not followed by a vowel with the consonant then an e. So, lb should become leb. Conversely, a string like la should not become lea, but ...
Otávio Barreto's user avatar
0 votes
0 answers
43 views

sed bash - replace only one character between match pattern

I have a file with the next information: [1,1,h][1,2,o][1,3,l][1,4,a][1,5, ][1,6,c][1,7,o][1,8,m][1,9,o][2,0, ][2,1,e][2,2,s][2,3,t][2,4,a][2,5,i][2,6,s][1,7,y][1,8,o] I would like to replace for ...
Valentin Luque's user avatar
0 votes
0 answers
30 views

How to replace hard coded value with dynamic input variable in the outputs - Github actions

Harded code value app_name was here and it worked fine -> app_namexx: ${{ steps.run-script.outputs.app_name }} I now wish to replace hard coded app_name to input variable key_name. So, Tried ...
Ashar's user avatar
  • 2,868
-2 votes
0 answers
19 views

How can i replace strings on a html page?

Can i replace some string elements on a specific element on a web page using replace() on developer console in chrome or firefox? I am not the programmer. I use a web page that generates text, and i ...
Rodrigo's user avatar
0 votes
0 answers
16 views

Replace with a wildcard and use the values of the wildcard in python? [duplicate]

Is it possible to do a replacement with a wildcard and use the values of the wildcard in Python? A simplified problem might look like this: import re txt = "Some text of SpaFrancein" tx = re....
Michael Gfrerer's user avatar
0 votes
2 answers
72 views

Replace space with a random character (there and back) in Python

The problem I have a haystack: source = ''' "El Niño" "Hi there! How was class?" "Me" "Good..." "I can't bring myself to admit that it all ...
trejder's user avatar
  • 17k
0 votes
1 answer
51 views

How to replace an apk default save data file?

I want to replace an apk default save data file . For example I have an app and i set some setting on the app settings or i progress on the app and it works better and is better optimized . I want to ...
Morteza Razavi's user avatar
0 votes
0 answers
29 views

Vb.net code cannot write from text file to my.settings variable

This is my code: Private Sub ButtonRead_Click(sender As Object, e As EventArgs) Handles ButtonRead.Click Dim path As String = "plik.txt" If File.Exists(path) Then Dim lines ...
Lamowy's user avatar
  • 1

1
2 3 4 5
556