If I knew the first thing about Python, I'd have figured this out myself just by referring to other similar questions that were already answered.
With that out of the way, I'm hoping you can help me achieve the following:
I'm looking to replace…
I am very new to nginx but i have been tasked with doing some rewrite rules to cover a new URI structure as part of a website migration. I have browsed this site and i see that there is a solution that I'm not sure will work for us.
Basically i take…
What is a good way to automate substitute commands in vim?
Suppose I have something like:
s/foo/bar/g
except much more complex and I want to run it on selected ranges without
having to type the substitute command?
How can I save the substitute…
Context
perl 5.22
multi-file transformation with perl oneliner
Overview
TrevorWattanStewie has a directory full of config files, and he wants to transform them.
The transformation operation is best understood by comparing "BEFORE" to…
I've got an XML-file with lots of the following code:
I need to replace code="NL" with code="IBA", but only when the BankAccount has INGB000 in it. I use the…
Data -----------------| ----- Formula ---|------------------- Date (Output) ------------------------------
(name - Aug 7, 2015) --------------------------------------------------------- 07/08/15
| -'}{[]//-;'; (lots of characters) (name - Aug…
I need this data to be formatted as a date and the only issue with my current formulae, is that some of the data shows only one digit as the day when the rest show two digits. Below shows the current formulas, the data always appears as this, in…
Originally I figured out how to remove the periods for all the files and then add them back:
Remove periods at end of titles
perl -pi -e 's/title = \{(.*)\.\},/title = \{$1\},/g' $1
# Add periods back so all files are the same (comment out if no…
I have a working solution from an earlier question I asked for finding csv files in a source directory (/foo/source), chopping off the first 233 lines using tail, and saving that to a file in a different directory (/foo/dest):
find /foo/source -name…
I'm trying to remove the characters \/<>~?`% if they appear within three <'s and >'s.
For the string:
Multiple <<<parameter>>> options %to <<<test/verify>>> in <<<one%…
Let's say I have downloaded some stock market data. Now, I am making it as a date list with continuous dates:
Now I need to assign a value of previous Friday to Sat and Sun. Whenever the stock market was off (like holidays or something), I need…
Hello I have a column with strings (names of products) in it.
Now these are formatted as Name LenghtxWidth, example Green box 20x30. Now I need to change the 20 with the 30 in this example so I get Green box 30x20, any ideas how I can achieve…
I am trying to use variables in s///. This example code works as expected:
my $regex1 = "e";
my $regex2 = "2";
my @array = ("one two three", "green blue red");
$_ =~ s/$regex1/$regex2/gee foreach (@array);
print $_ foreach (@array);
However, if…
I have a string that contains variable names separated by 'and's/'or's such as 'x[1] and x[2] or x[3]'. The number of variable names varies as does whether it's an 'and' or 'or' that comes in between them. I want to wrap parenthesis around each…