substitution Questions
2
Solved
I need to replace following line:
[rescap] l=1.2u w=1.5u
by
[rescap] l=1.2u w=1.5u r=0.8k
value of r 0.8k is l/w
I am trying in vim (already done in perl but wanted to implement using vim)
...
Pegasus asked 14/6, 2016 at 7:19
3
We have private git repos for a number of Ansible roles. The repo hosts vary from site to site, for example:
Site1 uses https://gitforsite1.ourdomain.com
Site2 uses https://gitforsite2.ourdomain...
Maximinamaximize asked 19/6, 2017 at 20:22
3
Solved
In Google Sheets, I have this in one cell:
Random stuff blah blah 123456789
<Surname, Name><123456><A><100><B><200>
<Surname2, Name2><456789><A&g...
Tuberculate asked 24/2, 2015 at 15:47
2
Solved
I have YAML find and replace value with correct YAML format (with space and quote). Below Sample YAML, I am able to replace jdbcUrl value using below Sed command. But, need help how to prefix...
Swansdown asked 9/2, 2019 at 15:44
3
Solved
How to automatically trim a comma off? So I don't have to remove it manually?
Messiah asked 12/4, 2019 at 23:24
3
Solved
I have an SQLite database with three columns, and I'm trying to use parameter substitution for tuples to SELECT rows. This is my table:
conn = sqlite3.connect("SomeDb.sqlite3")
conn.execute("""
C...
Chrysoprase asked 11/3, 2020 at 18:31
9
Solved
I would like to do the following:
$find = "start (.*) end";
$replace = "foo \1 bar";
$var = "start middle end";
$var =~ s/$find/$replace/;
I would expect $var to con...
Evetteevey asked 25/12, 2008 at 8:47
5
Solved
I have a query roughly like this:
select *
from A_TABLE
where A_COLUMN = '&aVariable'
union
select *
from A_TABLE
where B_COLUMN = '&aVariable';
But when I run it, SQL Develop...
Linseylinseywoolsey asked 9/4, 2009 at 18:41
3
Solved
I stacked with trying to pass variable through few functions, and on the final function I want to get the name of the original variable. But it seems like substitute function in R looked only in "l...
Ferris asked 19/6, 2014 at 15:5
2
Solved
I want to create several files from a single template, which differ only by a variable name. For example :
(file1.rst):
.. |variable| replace:: 1
.. include template.rst
(template.rst) :
Varia...
Battery asked 11/12, 2013 at 8:21
7
Solved
my question seems to be general, but i can't find any answers.
In sed command, how can you replace the substitution pattern by a value returned by a simple bash function.
For instance, I created ...
Ratcliffe asked 25/4, 2011 at 9:49
2
Solved
In this reST example meant to be rendered by Sphinx, |yaco_url| doesn't get replaced because it's in a code-block:
.. |yaco_url| replace:: http://yaco.es/
You can use wget to download it:
.. cod...
Cataclinal asked 11/1, 2012 at 15:5
4
Solved
I run several substitution commands as the core of a colorize script for maven.
One of the sed commands uses a regular expression which works find in the shell as discussed here. The current (not w...
Impropriety asked 19/5, 2013 at 18:6
4
Solved
How can I replace all occurrence of user defined latex macros with their definitions?
For example, given this file
old.tex
\newcommand{\blah}[2]{#1 \to #2}
...
foo \blah{egg}{spam} bar
...
how...
Tetreault asked 2/10, 2009 at 14:17
3
Solved
I would like to use substitute() to do variable substitutions inside expressions, without evaluating the expressions. For example, I have:
expr1 <- expression(if(x){
return(y)
} else {
return...
Winthrop asked 13/7, 2015 at 1:23
2
Solved
I have this regex.
$string =~ s/(?<!["\w])(\w+)(?=:)|(?<=:)([\w\d\\.+=\/]+)/"$1$2"/g;
The regex itself works fine.
But since I am am substituting alternatives (and globally), I always get...
Pomerleau asked 27/10, 2018 at 17:24
4
Solved
I am using Sphinx to document a webservice that will be deployed in different servers. The documentation is full of URL examples for the user to click and they should just work. My problem is that ...
Escrow asked 4/8, 2009 at 11:49
3
Solved
I'm new to shell programming. I intend to get directory name after zip file was extracted. The print statement of it is
$test.sh helloworld.zip
helloworld
Let's take a look at test.sh:
#! /bin/...
Relief asked 11/10, 2012 at 3:36
1
I'm trying to use str_replace_all to replace many different values (i.e. "Mod", "M2", "M3", "Interviewer") with one the consistent string (i.e. "Moderator:"). I'm doing this with multiple different...
Bimonthly asked 13/6, 2018 at 16:30
1
Solved
I've encountered an oddity using oracle's UTL_LMS.MESSAGE_FORMAT. When targeting %d replacements with variable substitutions, UTL_LMS is quietly failing to replace and disrupting exception-messagin...
Ep asked 15/5, 2016 at 18:42
2
Solved
Is there a way to do simultaneous substitutions with s///? For instance, if I have a string with a number of 1s, 2s, 3s, etc, and I want to substitute 1 with "tom", and 2 with "mary&...
Caffeine asked 4/9, 2018 at 3:36
7
Solved
I have Perl code:
my $s = "The+quick+brown+fox+jumps+over+the+lazy+dog+that+is+my+dog";
I want to replace every + with space and dog with cat.
I have this regular expression:
$s =~ s/\+(.*)dog...
Griseous asked 5/5, 2010 at 0:38
2
Solved
Suppose I have the bellow content in a file
file1.txt:
some text ...
...
begin
if somthing is true
some text here
...
fi
end
some text
I want to replace text between begin end includi...
Rocco asked 27/3, 2018 at 8:0
3
Solved
Given a bash variable holding the following string:
INPUT="Cookie: cf_clearance=foo; __cfduid=bar;"
Why is the substitution ${INPUT/cf_clearance=[^;]*;/} producing the output: Cookie: in...
Aught asked 31/1, 2018 at 12:34
2
Solved
For long and repeating models I want to create a "macro" (so called in Stata and there accomplished with global var1 var2 ...) which contains the regressors of the model formula.
For example from...
Breeden asked 7/10, 2017 at 0:58
© 2022 - 2024 — McMap. All rights reserved.