substitution Questions
5
Solved
I have a column in a dataset looking like this:
cluster_id
1
1
1
1
NA
1
NA
NA
2
NA
2
NA
3
NA
NA
3
cluster_id <- c("1","1","1","1","NA","1...
Hottempered asked 27/9 at 10:0
2
Solved
Suppose you have this text:
name1 = "John"; age1 = 41;
name2 = "Jane"; age2 = 32;
name3 = "Mike"; age3 = 36;
...
and you want to split each line into two lines to give a result like this:
name1...
Dachau asked 16/7, 2013 at 2:28
2
Solved
In fish shell, I want to be able to expand a command substitution or variable as multiple arguments to another command, e.g.:
Without substitution
ls -l -h
Should give the same result as:
ls $(ech...
Cauldron asked 24/9, 2023 at 16:46
6
Solved
I am trying to set up a function to reformat a string that will later be concatenated. An example string would look like this:
Standard_H2_W1_Launch_123x456_S_40K_AB
Though sometimes the "S" doe...
Mckelvey asked 11/3, 2014 at 0:13
7
Solved
I saw other questions dealing with the finding the n-th occurrence of a word/pattern, but I couldn't find how you would actually substitute the n-th occurrence of a pattern in vim. There's the obvi...
Monitory asked 19/6, 2010 at 0:39
14
Solved
#!/bin/bash
jobname="job_201312161447_0003"
jobname_pre=${jobname:0:16}
jobname_post=${jobname:17}
This bash script gives me Bad substitution error on Ubuntu. Any help will be highly ap...
Pisciculture asked 16/12, 2013 at 16:1
8
In Unix the ^ allows you to repeat a command with some text substituted for new text. For example:
csh% grep "stuff" file1 >> Results
grep "stuff" file1
csh% ^file1^file2^
grep "stuff" file2...
Howlyn asked 19/12, 2008 at 20:37
4
Solved
Let's say I have two variables:
a="AAA"
b="BBB"
I read a string from a file. This string is the following:
str='$a $b'
How to create a new string from the first one that substitutes the varia...
Si asked 7/1, 2015 at 9:57
6
Solved
I am trying to change the values in a text file using sed in a Bash script with the line,
sed 's/draw($prev_number;n_)/draw($number;n_)/g' file.txt > tmp
This will be in a for loop. Why is it...
Washedout asked 6/10, 2011 at 21:11
7
Solved
I've always used an interface based git client (smartGit) and thus don't have much experience with the git console.
However, I now face the need to substitute a string in all .txt files from histo...
Televise asked 5/11, 2010 at 22:33
8
Solved
I need to scrub a column of names in Excel to eliminate all non-Alpha characters including periods, commas, spaces, hyphens and apostrophes.
EXAMPLE:
Change O'Malley-Smith, Tom, Jr. to OMALLEYSMI...
Kowalski asked 19/3, 2015 at 16:23
6
Solved
Rearrange Numbers in String
Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with d...
Hyaluronidase asked 9/7, 2021 at 11:12
2
Solved
I am trying to convert a string into date format in Google Sheet. I've tried different formulas but failed. I guess REGEXMATCH may solve this or even Google Apps Script can also solve this. But I p...
Exceed asked 1/4, 2022 at 1:43
1
Solved
I declare a variable, define an expression using the variable
from sympy import *
x = symbols ('x')
f = 2 * x
and then assign a value to the variable
x = 42
How can I substitute the variable in ...
Roderic asked 25/3, 2022 at 9:57
4
Everybody says eval is evil, and you should use $() as a replacement. But I've run into a situation where the unquoting isn't handled the same inside $().
Background is that I've been burned too o...
Solitude asked 8/10, 2012 at 20:35
3
Solved
I don't understand the logic in the functioning of the scape operator \ in python regex together with r' of raw strings.
Some help is appreciated.
code:
import re
text=' esto .es 10 . er - 12 .23...
Telephony asked 10/6, 2019 at 9:15
7
Example:
value
desired output
300
Three Hundred
300.50
Three Hundred and 50 cents
I can't find a way to do this in Google Sheets, and I am not savvy enough to build anything.
Folium asked 22/2, 2019 at 16:10
4
Solved
I get a lot of database information from clients in excel spreadsheets. I frequently need to insert/update this data back into the database.
I often use excel to generate the insert and update st...
Purington asked 26/9, 2014 at 19:34
2
Solved
I have a list of tweets, many of which contain emojis that need to be removed. What would be the most effective method for doing this in R?
I have tried the following method which is supposed to ...
Redbug asked 6/7, 2016 at 2:37
5
Solved
In Ruby, I have:
require 'uri'
foo = "et tu, brutus?"
bar = URI.encode(foo) # => "et%20tu,%20brutus?"
I'm trying to get bar to equal "et%20tu,%20brutus%3f" ("...
Depolymerize asked 13/2, 2009 at 18:29
2
Solved
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe
Taiwan 55 144 Asia
North Korea 44 2134 Asia
The above is my data file.
There are empty lines in it.
Ther...
Disarticulate asked 10/8, 2018 at 9:4
8
Solved
I'm trying to remove all newline characters from a string. I've read up on how to do it, but it seems that I for some reason am unable to do so. Here is step by step what I am doing:
string1 = "He...
Auroora asked 8/11, 2012 at 22:23
7
Solved
I'm trying to iterate through a collection and display information in a SendGrid template using Ruby on Rails.
recipient = SendGrid::Recipient.new("[email protected]")
recipient.add_substitut...
Whitneywhitson asked 28/12, 2015 at 14:24
1
Solved
I'm trying this:
https://docs.docker.com/compose/environment-variables/#substitute-environment-variables-in-compose-files
and as stated by the documentation, this is my docker-compose.yml:
services...
Orion asked 23/10, 2020 at 11:23
2
Solved
I want to make multiple substitutions to a string using multiple regular expressions. I also want to make the substitutions in a single pass to avoid creating multiple instances of the string.
Let'...
Anya asked 19/2, 2021 at 0:21
1 Next >
© 2022 - 2024 — McMap. All rights reserved.