Questions tagged [substitution]

The action of replacing something with another thing.

The action of replacing something with another thing.

1879 questions
0
votes
1 answer

how to substitute all occurrences of a substring with parameters in Java?

I have the following string: "useless text $TABLE[1]$ other useless text $TABLE[2]$ useless text..." I want to substitute the occurrences of the substring "$TABLE[x]$" with something like "< table id='x'>". So I need to get back the id from the…
RiccardoB
  • 141
  • 15
0
votes
1 answer

HTML variables in Sphinx

I'm trying to have a variable in conf.py that inserts a link that is applied on a string: rst_epilog = """ .. |support| replace:: `support team `_ """ In this case 'support team' would turn into a link pointing to the email…
Flag
  • 497
  • 1
  • 3
  • 17
0
votes
3 answers

VBA Microsoft for MSword Macro using a wildcard including a string variable

word VBA programmers, Problem: Working in MS word the user would select a string (one or several words), just asume "word1 word2" is selected. The macro would look in the whole document if there is such a string followed by references in parentheses…
JFerro
  • 3,203
  • 7
  • 35
  • 88
0
votes
3 answers

why does appending a substituted List, modify the orginal list too in python?

I want to manipulate a List in python while keeping the original List untouched. So I've substituted the Original List into a new defined variable as below : Original_List = [1,5] Substituted_List = Orginal_List But I've noticed doing…
Mohsen Haddadi
  • 1,296
  • 2
  • 16
  • 20
0
votes
1 answer

How do I substitute the following string in Excel using =SUBSTITUTE

Using =SUBSTITUTE I have the string in A1: [{"LeadPhoneID":3337624,"CallDate":"/Date(1495638988456+0100)/","UtcCallDate":"/Date(1495638988456+0100)/","Attempt":0,"Status":2,"ResultCode":"OE04","LeftMessage":false,"UserID":223,"Notes":""}] I am…
Paul Young
  • 133
  • 2
  • 8
0
votes
1 answer

How to optimize a sequence of multiple sed replacements?

I am trying to clean-up some bash code from unnecessary repetiotions. Currently it looks like this (example values): pattern1='aaa' pattern2='bbb' pattern3='ccc' replacement1='XX' replacement2='YY' replacement3='ZZ' tail $LOGS | sed -e…
george
  • 432
  • 1
  • 3
  • 18
0
votes
0 answers

Python: looping code to substitute values from a list into variables in code

Let's say I have the following code below: df_HA_noHA_append_5_X = df_HA_noHA_append_5[df_HA_noHA_append_5['Region'] == 'Y'] I want X to be different values from a list. For example I want X to be substituted in by: df_list = [Central, West, East,…
PineNuts0
  • 4,740
  • 21
  • 67
  • 112
0
votes
0 answers

Best practice to substitute values on a page (tokens), without using (pure) PHP?

I am in currently upgrading a simple templating system for users who create their own pages, and would like them to be able to insert a set of their own pre-set "variables". Here is the workflow: Client textarea --> saved to database --> pulled…
Zak
  • 6,976
  • 2
  • 26
  • 48
0
votes
0 answers

how closely does vim search and replace follow regex?

how strictly does vim search and vim substitute follow regex? For example, this is a whole word search in regex: \bwordtofind\b but in vim normal mode, this command does NOT work: /\bwordtofind\b but some regex commands do work, for example,…
Kwolf
  • 2,001
  • 2
  • 12
  • 4
0
votes
2 answers

Java: Substitution of numbers on a given String with the correspondent ID

I' ve got a String like this: "[1] ,[2,4], [1,2,3] ,[12,42]..." that has non predictable structure (i.e. there could be more parentheses or more numbers inside them). The numbers correspond to a certain id that is contained in a HashMap. For…
0
votes
1 answer

How to reverse the regex in contractions tokenization?

In nlp tokenization, the contractions are sometimes split up as such: >>> import re >>> s = 'he cannot fly' >>> pattern, substitution = r"(?i)\b(can)(not)\b", r" \1 \2 " >>> re.sub(pattern, substitution, s) 'he can not fly' To reverse it (i.e.…
alvas
  • 115,346
  • 109
  • 446
  • 738
0
votes
0 answers

Multiple Substitute from a list using wildcard characters Excel

I'm trying to remove and replace in a long column of string variables (>14,000) specific misspellings or redundancies from a list that I have made in another column. So far I am able to replace specifically from the list using the following…
E.Lost
  • 1
  • 1
0
votes
2 answers

Python regular expression sub

So I am running into something I cant explain and was hoping someone could shed light on... Here is my code: fd = open(inFile, 'r') contents = fd1.readlines() fd.close() contentsOrig = contents contents[3] = re.sub(replaceRegex, thingToReplaceWith,…
Sharki
  • 375
  • 2
  • 14
0
votes
3 answers

Using awk how to to merge lines which are duplicates based on multiple columns and substitute the average for another column

This is a variant on Using awk how do I print all lines containing duplicates of specific columns? Input: a;3;c;1 a;6;b;2 a;5;c;1 Output: a;4;c;1 a;6;b;2 Hence, all lines which have duplicates of columns 1,3 and 4 should be merged to one line and…
Markus
  • 69
  • 6
0
votes
1 answer

Altering Built in Substitution Strings in Oracle Apex

I am trying to modify the LOGIN_URL and APP_ID substitution variables in oracle apex. Does anybody know where these values are stored and/or how to edit them. Info on substitution strings:…
Michael Artman
  • 319
  • 1
  • 14