text-replacement

Getting sed to Replace Text With Argument

Alright, I know this is a simple question, but I can't seem to get this sed command to work. I'm trying to get a text file and replace one bit of it from placeholder text to a study code. The study code that it is going to replace it with is passed into the script using arguments when the script is first ran. The problem is, when I tr...

Can I use Win32 COM to replace text inside a word document?

I have to perform a large number of replacements in some documents, and the thing is, I would like to be able to automate that task. Some of the documents contain common strings, and this would be pretty useful if it could be automated. From what I read so far, COM could be one way of doing this, but I don't know if text replacement is s...

Accessing the currently selected element's content in a html(val) statement in jQuery?

I have a several links whose text content I'd like to replace with a automatically generated image based on the text content. So currently it looks like this: <a href="blabla" class="mLink"> <span class="mText">The Text in Question</span> </a> and I would like to have either <a href="blabla" class="mLink"> <img src="/ImageTextHandle...

Find and Replace in Files - UTF8

Searching for a free application for commercial usage that allows find/replace in multiple files (regular expressions are nice but not a must), that supports opening and saving in UTF-8. Tried a few like BKReplaceEm but the application ends up saving all the files as ASCII which causes some problems with web-rendering. Please advise. ...

Loop through text nodes inside a div

I am trying to do a text replace, but to do so, i need to loop through the text nodes of a div. Each Div upon clicking, loads via ajax it's appropriate content. But then I need to do text-replacing inside any of the text nodes inside there. My current code, after loading the ajax content, loops through all text nodes of the whole page,...

By passing div id, can i change target of text replacement?

I am using the code below to replace text inside a div. But I need to loop through a specific div, instead of everything on the page, that is the div's text nodes... I just do not understand how to refer to the div in the code below. (function (parent) { var childs = parent.childNodes; // if there are children to this if (childs &...

How Do I Convert Pipe Delimited to Comma Delimited with Escaping

Hi, I am fairly new to scala and I have the need to convert a string that is pipe delimited to one that is comma delimited, with the values wrapped in quotes and any quotes escaped by "\" in c# i would probably do this like this string st = "\"" + oldStr.Replace("\"", "\\\\\"").Replace("|", "\",\"") + "\"" I haven't validated that a...

I have an array on strings in php. I want to replace all occurrences of those strings with another string within a block of text

I have an array that contains several domain names. I need to replace those domains inside blocks of text (forum posts) with another string, if any of them actually appear inside that forum post. Whats the best way of doing that? I can't alter the array that contains a list of domains it would search for. Its stored as follows: $doma...

Replacing file content in PHP

I need a function just like preg_replace but instead of strings I need it to work with files / file content. ...

how to fill text templates using xslt

I have an XML file with information, for example: <letter> <name>Test</name> <age>20</age> <me>Me</me> </letter> And then I have an text template like: Dear $name, some text with other variables like $age or $name again greatings $me When using xslt to transform the XML to the plain text letter I can use something like: <x...

javascript regular expression for pretty formatting user text

Hello I am doing a research here to find you the best way to format user text messages. A sample of what I am trying to achieve: 1) user sends this message: Doctor, I would like to have an appointment tomorrow morning.Please,call me! 2) my application formats this text outputting this: Doctor, I would like to have an appo...