replace

Trying to standardize exports

I am trying to standardize my exports file. I need to remove all spaces and tabs between the first two fields and replace them with two tabs. I am using VI. So I want to change /vol/vol1/home1/xxx -rw=admin:app:admhosts to /vol/vol1/home1/xxx -rw=admin:app:admhosts making the space equil to To two TABS. I am using VI....

VIM: substitute with contents of register / lines range

I'm using VIM, and I want to substitute some placeholder text with a long string, that spans several lines, which is already written somewhere else in the file. Is it possible to replace a pattern with the contents of a register? Something like :%s/foo/<contents of register A> Otherwise, is it possible to replace with a range of line...

Vim replace selected text

Lets say we have a a text and i enter in visual mode and select a text and how do i quickly do a search for the highlight text and replace it with something else thanks ...

Is there a best practice for string replacement in .aspx pages?

I have an .aspx page setup. I have a lot of placeholders that need to be replaced. First name, last name, city, state, etc, etc. How do I go about doing this in an efficient manner? Drop a bunch of... <asp:Label runat="server" id="Label_FirstName" Text="" /> ...everywhere? Or is there a way to use the data binding syntax in the n...

VBScript 800a005e Error

I'm using old VBScript in my ASP application. Trying to search and replace string using Replace(wholeText, textToSearch, textToReplace) function but i'm getting the following error: Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'Replace' /instance/inst_spam_gen_4.asp, line 25 And here is my function: Function cl...

replace image through css

okay backstory. I'm writing code in Stylish, a firefox plugin, to change the image that is shown up. the image property doesn't have a div tag, so i have to use this: img[src*="s_dschjungelplanet"]{ ########## } So this will replace "s_dschjungelplanet" anywhere in the page, in a img src. so my main problem is that im not sure HOW ...

Javascript token replace/append

Hi guys I have a string that looks something like the following 'test:1;hello:five;just:23'. With this string I need to be able to do the following. .... var test = MergeTokens('test:1;hello:five;just:23', 'yes:23;test:567'); ... The end result should be 'test:567;hello:five;just:23;yes:23' (note the exact order of the tokens is not ...

C# Regex Replace Question

if i have a string like this "Hello - World - Hello World" I want to replace the characters PRECEDING the FIRST instance of the substring " - " e.g. so replacing the above with "SUPERDOOPER" would leave: "SUPERDOOPER - World - Hello World" So far I got this: "^[^-]* - " But this INCLUDES the " - " which is wrong. how to do this wit...

.NET String.Replace

I am so annoyed. Typically I like replace acting as it does in C# but is there a C++ styled replace where it only replaces one letter at a time or the X amount I specify? ...

Efficient in-line search and replace for large file

Hi. There are some standard tools to do this, but I need a simple GUI to assist some users (on windows). They will get an open file dialog and pick the file to process. The file will be an XML file. The file will contain (within the first few lines) a text string that needs to be deleted or replaced with whitespace (doesn't matter which...

How to Replace Multiple Characters in Access SQL?

I'm a novice at SQL, so hopefully someone can spell this out for me. I tried following the "Replace Multiple Strings in SQL Query" posting, but I got stuck. I'm trying to do the same thing as the originator of the above posting but with a different table and different fields. Let's say that the following field "ShiptoPlant" in table "...

I'm looking for an application/text editor that....

can best help me systematically modify the "replace" field of a regex search as it encounters each match. For example, I have an xml file that needs the phrase "id = $number" inserted at regular points in the text, and basically, $number++ each time the regex matches (id = 1, id = 2, etc) until the end of the file. I know I could just ...

How to work with unicode in Python

I am trying to clean all of the HTML out of a string so the final output is a text file. I have some some research on the various 'converters' and am starting to lean towards creating my own dictionary for the entities and symbols and running a replace on the string. I am considering this because I want to automate the process and ther...

Some Basic Python Questions

I'm a total python noob so please bear with me. I want to have python scan a page of html and replace instances of Microsoft Word entities with something UTF-8 compatible. My question is, how do you do that in Python (I've Googled this but haven't found a clear answer so far)? I want to dip my toe in the Python waters so I figure somet...

Removing ? from document.location.search

How can I place document.location.search into a variable w/o the '?' Is there a simple regex, or can I just ignore the first character? ...

Replace text in Word Document with ActiveX?

Hi there. I want replace some string within Word Document using ActiveX and JavaScript, now I have something like this: var text = Selection.Text; Selection.Text = text.replace('somesting','somevalue'); But after that I loose all formaing. If I record macros in WinWord I get this: With Selection.Find .Text = "somestring" .Rep...

QTP/VBScript: How to remove all URLs from a string?

I have a string in my QTP test project. In some cases, this string is a plaintext E-mail's content; in other cases it's HTML. In both cases, I need to strip all URLs from the string to match it against an Expected case. How can this be done in QTP/VBScript? ...

Find and Replace within selection in `vi`

How do I do a Find and Replace within a selection in vi? ...

Changing lines in a file

I'd like to replace (as an example) the text of lines 5-15 in a file with the text from lines 6-15 from another file. But I'd like to do this over about 2000 files, and would rather not have to do it manually. I could script something in perl, but I'd like to try to do it with any built-ins possible. ...

Slashes instead of quotes in JavaScript string replace method.

Why do they use / instead of ' in JavaScript string replace()? E.g.: document.write(str.replace(/hi/, "hey")); ...