0
голосов
1ответов
174 просмотров

MySQL - Search and replace table1.field's contents with contents of table2.otherfield

I need a MySQL query that will do the following: Instead of the alpha team names in the 3rd column of the players table, I want it to reference teams.id table: players id player_name team ------------------------------------------ 1 Sue Smith Silly Chimps 2 ...

13
голосов
5ответов
24625 просмотров

Replace strings in files by Python

How can you replace the match with the given replacement recursively in a given directory and its subdirectories? Pseudo-code import os import re from os.path import walk for root, dirs, files in os.walk("/home/noa/Desktop/codes"): for name in dirs: re.search("dbname=noa...

0
голосов
3ответов
482 просмотров

How to change html part of a tag with jquery?

I have , `<span class="icon">►</span>` in Jquery I did, $(this).html('▼'); and tried $(this).replaceWith('▼'); too. but it displays '▼' instead of converting it to a html icon like ▼. thanks

2
голосов
2ответов
1455 просмотров

String replacing in a file by given position

I have a file opened in 'ab+' mode. What I need to do is replacing some bytes in the file with another string's bytes such that: FILE: thisissomethingasperfectlygood. string: 01234 So, for example, I seek for the position (4, 0) and I want to write 01234 in the place of "issom" in the fil...

6
голосов
3ответов
8894 просмотров

How can I add an underscore before each capital letter inside a Java String?

I have a string like this "HelloWorldMyNameIsCarl" and I want it to become something like "Hello_World_My_Name_Is_Carl". How can I do this?

0
голосов
1ответов
67 просмотров

Storing a piece of the string for later use in replacement

Not sure if the subject was clear, hard to describe, easy to show: I need to convert this: $text = 'Bunch of text %img_Green %img_Red and some more text here'; to this: $text = 'Bunch of text <img src="/assets/images/Green.gif" alt="Green" /> <img src="/assets/images/Red.gif" alt="...

56
голосов
7ответов
105263 просмотров

How to find and replace all occurrences of a string recursively in a directory tree?

Using just grep and sed, how do I replace all occurrences of: a.example.com with b.example.com within a text file under the /home/user/ directory tree recursively finding and replacing all occurrences in all files in sub-directories as well.

693
голосов
35ответов
537551 просмотров

How to do a recursive find/replace of a string with awk or sed?

How do I find and replace every occurrence of: subdomainA.example.com with subdomainB.example.com in every text file under the /home/www/ directory tree recursively?

0
голосов
5ответов
1015 просмотров

SQL Server Express: REPLACE problem in SQL Server Mgmt Studio Express

I have a huge problem with the REPLACE SQL function in Microsoft SQL Server Management Studio Express. When I do following query SELECT REPLACE('ArticleNumber', 'S401', 'I0010') SELECT REPLACE('ArticleNumber', 'S302', 'I0020') SELECT REPLACE('ArticleNumber', 'S303', 'I0030') SEL...

0
голосов
2ответов
848 просмотров

Replace flash with javascript

I have next mission: i have to replace flash alement with javascript in this page: http://www.fplus.si/ (changing the images with buttons for every image) Afcourse it has to look and work excactly the same. I found some jquery modules that do almost like this, but there are not the same. did som...

0
голосов
4ответов
3311 просмотров

Replace www.example.com w/ <a href="http://www.example.com">www.example.com</a>

I am not very good at regex, but I need to convert the following example from this &lt;li&gt;Creations by Carol - www.driedfloralcreations.com&lt;/li&gt; to &lt;li&gt;Creations by Carol - &lt;a href="http://www.driedfloralcreations.com" rel="external"&gt;www.driedfloralcreations.com&lt;/a&gt;...

2
голосов
5ответов
1029 просмотров

Replacing all <br> with <br>

I'm using this (jQuery) to replace all &lt;br&gt;s with &lt;br /&gt; to clear out validation errors: $("&lt;br&gt;").replaceAll("&lt;br /&gt;"); but it doesn't reduce any validation errors. Does validator check the original source?

0
голосов
2ответов
305 просмотров

to remove href attr from all the anchor tags using Reg Ex

i am trying to remove href attr from all the anchor tags using Reg Ex,for print page. Although i need the text value in anchors.

0
голосов
2ответов
644 просмотров

jquery .each loop and replace to same location?

i got help (Select a Tag with a Selector from a Text Variable using jQuery) on looping the static var and replacing it value, but just one question is left from it, is how can i replace finded tags with newly changed tags in the text area Code: var length = 30; var end = '...'; var text = `...

1
голосов
3ответов
350 просмотров

Replace strings in file

I have to replace in a following manner if the string is "string _countryCode" i have to replace it as "string _sCountryCode" as you can see where there is _ I replace it with _s followd be next character in capitals ie _sC more examples: string _postalCode to be replaced as string _sPostalCo...

6
голосов
2ответов
16115 просмотров

PHP - Replace colour within image

I hope someone can help, I have made a script that masks images... however it is reliant on a colour to mask with ( 'green screen' style). The trouble is if the image that I am masking contains that colour it is ruined. What I am looking to do is prior to masking the image replace any occurance...

0
голосов
4ответов
1796 просмотров

mySQL/PHP to update if the row exists or else insert when column to check is not unique

I have read about REPLACE and INSERT ON DUPLICATE key queries, and while I can see how useful they are, they don't appear to work for my purposes. Perhaps my database design is off from how it should be, but either way I hope I can get this working. I am trying to mock up an online store to teac...

2
голосов
2ответов
2010 просмотров

Search and replace strings in PDF with Perl, Ruby, or PHP

Is there a way to script replacing strings in PDF documents? I can use either Perl, Ruby or PHP. If possible, a regular expression would be a great.

2
голосов
4ответов
17603 просмотров

How to Replace a line in the same file by SED in Unix Shell scripting?

In Reference to this question After getting the line identifier matching in first and second file I need to replace the line in first file with the line of second file.For that I am using SED as below. But Sed only replaces that line in a new file. How can I achieve the update in same file withou...

1
голосов
1ответов
78 просмотров

Which UNIX tool should I use to handle a substitution list?

Suppose I have one file A which is a list with a two-digit key numbers and three-digit subject numbers. Now suppose I have a second file B containing a list of pairs of subject numbers. I want to substitute in key numbers for pair numbers in file B. My question is, what is the right UNIX tool fo...

137
голосов
7ответов
683510 просмотров

Replace values in list using Python

I have a list where I want to replace values with None where condition() returns True. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] For example, if condition checks bool(item%2) should return: [None, 1, None, 3, None, 5, None, 7, None, 9, None] What is the most efficient way to do this?

39
голосов
8ответов
56627 просмотров

Remove whitespace and line breaks between HTML elements using jQuery

Using jQuery, I'd like to remove the whitespace and line breaks between HTML tags. var widgetHTML = ' &lt;div id="widget"&gt; &lt;h2&gt;Widget&lt;/h2&gt;&lt;p&gt;Hi.&lt;/p&gt; &lt;/div&gt;'; Should be: alert(widgetHTML); // &lt;div id="widget"&gt;&lt;h2&gt;Widget&lt;/h2&gt;&l...

2
голосов
2ответов
4980 просмотров

Search and Replace of text in a memorystream in C# .NET

I have loaded a memorystream with a word document and I want to be able to alter specific text within the memorystream and save it back to the word document, like search and replace functionality. Please can anyone help me with this as I don't want to use the Word Interop libraries. I have the ...

3
голосов
3ответов
2313 просмотров

XML field replacement in C#

ok, so, i have an xml file that looks like this: &lt;?xml version="1.0"?&gt; &lt;Users&gt; &lt;User ID="1"&gt; &lt;nickname&gt;Tom&lt;/nickname&gt; &lt;password&gt;a password&lt;/password&gt; &lt;host&gt;[email protected]&lt;/host&gt; &lt;email&gt;anemail&lt;/email&gt; &lt;...

0
голосов
3ответов
2753 просмотров

Javascript replace doesn't work when it should

var src = "http://blah.com/SOMETHING.jpg"; src.replace(/.*([A-Z])\.jpg$/g, "X"); at this point, shouldn't src be: http://blah.com/SOMETHINX.jpg If I use match() with the same regular expression, it says it matched. Regex Coach also shows a match on the character "G".

2
голосов
3ответов
2087 просмотров

Replace Subversion Folder and Retain History

I have two development trees v3.3, and v3.4 in one SVN repository. They both contain a project called test-harness. However, the v3.4 developers have wrecked the test-harness so we need the test-harness from project in v3.3 to overwrite what we have in v3.4. I want to retain the history of change...

1
голосов
1ответов
66 просмотров

Is there enough information to know what this regex is searching and replacing?

Could anyone explain what's being replaced here? I don't know if enough information is present to understand what's being searched and what's being replaced: regEx.Pattern = "(\s) *(\S)" regEx.Global = True that = regEx.Replace(that, "$1$2")

-2
голосов
1ответов
387 просмотров

c function call

I'm trying to take this code ... char mysmooth1_ descr[] = "my smooth1: My smooth1 replaced avg() func. and assign sum to pixel"; void mysmooth1 (int dim, pixel *src, pixel *dst) { int i, j; int ii, jj; pixel_ sum sum; pixel current_ pixel; for (i = 0; i &lt; dim; i++) fo...

1
голосов
1ответов
11513 просмотров

Word VBA - Find text between delimiters and convert to lower case

I would like to find text which is between the characters, and then turn any found text into "normal" case, where first letter of word is capitalized. Here is what I have thus far: Function findTextBetweenCarots() As String Dim strText As String With Selection .Find.Text = "&lt;" ' what ...

0
голосов
6ответов
4257 просмотров

SQL Statement Match Anything

I use a regex in my SQL statements for an app that look like this SELECT * FROM table WHERE id = {{REPLACEME}} However, sometimes I'm not giving a parameter to replace that string with. Is there a way to replace it with something that matches anything. I tried *, but that does not work.