Search Results

Search found 9447 results on 378 pages for 'str replace'.

Page 7/378 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • PHP mySQL - replace some string inside string

    - by apis17
    i want to replace ALL comma , into ,<space> in all address table in my mysql table. For example, +----------------+----------------+ | Name | Address | +----------------+----------------+ | Someone name | A1,Street Name | +----------------+----------------+ Into +----------------+----------------+ | Name | Address | +----------------+----------------+ | Someone name | A1, Street Name| +----------------+----------------+ Thanks in advance.

    Read the article

  • Smart search/replace in Vim

    - by Amir Rachum
    I have a file with the following expressions: something[0] Where instead of 0 there could be different numbers. I want to replace all these occurances with somethingElse0 Where the number should be the same as in the expression I replaced. How do I do that?

    Read the article

  • Easiest way to recursively find and replace?

    - by FarmBoy
    I want to recursively search through a directory of text files and replace every occurrence of foo within the files with bar. What is the easiest way to accomplish this? I imagine that grep would do the job in one line, but I can't seem to find an example of this. I'm working in OS X.

    Read the article

  • php preg replace

    - by David
    I'm trying to build a PHP preg replace string when processing poorly written xml, such that if I am given: $x='<abc x="y"><def x="g">more test</def x="g"><blah>test data</blah></abc x="y">'; That it checks if there's a space within a closing tag and deletes everything from the space to the end of the tag such that. becomes <abc x="y"><def x="g">more test</def><blah>test data</blah></abc> thanks

    Read the article

  • Problem with Replace in Eclipse

    - by Imran
    I'm using regex to match all non-quoted property names in my json files. Eclipse has no problem finding the desired matches, but when I want to replace the matched strings with "$2", I get this error: Match string has changed in file filename.json. Match skipped Here's the regex I'm using: `((\w+)\s*(?!['"])(?=:))` Any idea on how to work around this issue?

    Read the article

  • Find and replace braced tags within a MySQL table

    - by Cy
    I have about 40000 records in that table that contains plain text and within the plain text, contains that kind of tags which its only characteristic is that they are braced between [ ] [caption id="attachment_2948" align="alignnone" width="480" caption="the caption goes here"] How could I remove those? (replace by nothing) I could also run a PHP program if necessary to do the cleanup.

    Read the article

  • How to replace {tag_INDEX} with array[INDEX] element

    - by ekapek
    Hi, I have string like this; "String {tag_0} text {tag_2} and {tag_1}" Now i need to replace all {tag_INDEX} with elements from array $myArray = array('a','b','c'); so after replacement it should looks like: "String a text c and b" What is the best way to do this? I'm trying with preg_replace and preg_replace_callback but without any good results

    Read the article

  • replace NA in an R vector with adjacent values

    - by pssguy
    I have a dataframe which has merged player and team data for soccer seasons So for a particular player in a specific season I have data like df <- data.frame(team=c(NA,"CRP",NA,"CRP","CRP",NA), player=c(NA,"Ed",NA,"Ed","Ed",NA), playerGame= c(NA,1,NA,2,3,NA), teamGame =c(1,2,3,4,5,6)) Where the NA's indicate that the player did not appear in that specific team game How would I most efficiently replace the team and player NA's with "CRP" and "Ed" respectively and have a plGame output of, in this instance, 0,1,1,2,3,3

    Read the article

  • String replace for personalize code generator

    - by Xurxof
    I must do a automatic codes generator with user-configurable string with predefined keys and can not find a good way to do it. For example, a string OT-{CustomCode}-{Date}-{##} could generate codes OT-C0001-20100420-01 OT-C0001-20100420-02 I thought of using RegExpr.Replace(), but I would have problems if the code of a customer was {##} Any help is welcome! (and sorry for my english)

    Read the article

  • How to program a text search and replace in PDF files

    - by rpilkey
    How would I be able to programmatically search and replace some text in a large number of PDF files? I would like to remove a URL that has been added to a set of files. I have been able to remove the link using javascript under Batch Processing in Adobe Pro, but the link text remains. I have seen recommendations to use text touchup, which works manually, but I don't want to modify 1300 files manually.

    Read the article

  • Replace non-html links with <A> tags

    - by tombazza
    I have a block of code that will take a block of text like the following: Sample text sample text http://www.google.com sample text Using the preg_replace_callback method and the following regular expression: preg_replace_callback('/http:\/\/([,\%\w.\-_\/\?\=\+\&\~\#\$]+)/', create_function( '$matches', '$url = $matches[1]; $anchorText = ( strlen($url) > 35 ? substr($url, 0, 35).\'...\' : $url); return \'<a href="http://\'. $url .\'">\'. $anchorText .\'</a>\';'), $str); Will convert the sample text to look like: Sample text sample text < a href="http://www.google.com"http://www.google.com< /a sample text My problem now is that we have introduced a rich text editor that can create links before being sent to the script. I need to update this piece of code so that it will ignore any URLs that are already inside an tag.

    Read the article

  • Replace BIT values with some text

    - by nihi_l_ist
    I have a BIT column with gender (0,1) and want to replace 0 and 1 in the resulting view with the words "man" and "woman". Can i do this right in the view with some system finction or i have to write my own function to do that?

    Read the article

  • multi_index composite_key replace with iterator

    - by Rohit
    Is there anyway to loop through an index in a boost::multi_index and perform a replace? #include <iostream> #include <string> #include <boost/multi_index_container.hpp> #include <boost/multi_index/composite_key.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> using namespace boost::multi_index; using namespace std; struct name_record { public: name_record(string given_name_,string family_name_,string other_name_) { given_name=given_name_; family_name=family_name_; other_name=other_name_; } string given_name; string family_name; string other_name; string get_name() const { return given_name + " " + family_name + " " + other_name; } void setnew(string chg) { given_name = given_name + chg; family_name = family_name + chg; } }; struct NameIndex{}; typedef multi_index_container< name_record, indexed_by< ordered_non_unique< tag<NameIndex>, composite_key < name_record, BOOST_MULTI_INDEX_MEMBER(name_record,string, name_record::given_name), BOOST_MULTI_INDEX_MEMBER(name_record,string, name_record::family_name) > > > > name_record_set; typedef boost::multi_index::index<name_record_set,NameIndex>::type::iterator IteratorType; typedef boost::multi_index::index<name_record_set,NameIndex>::type NameIndexType; void printContainer(name_record_set & ns) { cout << endl << "PrintContainer" << endl << "-------------" << endl; IteratorType it1 = ns.begin(); IteratorType it2 = ns.end (); while (it1 != it2) { cout<<it1->get_name()<<endl; it1++; } cout << "--------------" << endl << endl; } void modifyContainer(name_record_set & ns) { cout << endl << "ModifyContainer" << endl << "-------------" << endl; IteratorType it3; IteratorType it4; NameIndexType & idx1 = ns.get<NameIndex>(); IteratorType it1 = idx1.begin(); IteratorType it2 = idx1.end(); while (it1 != it2) { cout<<it1->get_name()<<endl; name_record nr = *it1; nr.setnew("_CHG"); bool res = idx1.replace(it1,nr); cout << "result is: " << res << endl; it1++; } cout << "--------------" << endl << endl; } int main() { name_record_set ns; ns.insert( name_record("Joe","Smith","ENTRY1") ); ns.insert( name_record("Robert","Brown","ENTRY2") ); ns.insert( name_record("Robert","Nightingale","ENTRY3") ); ns.insert( name_record("Marc","Tuxedo","ENTRY4") ); printContainer (ns); modifyContainer (ns); printContainer (ns); return 0; } PrintContainer ------------- Joe Smith ENTRY1 Marc Tuxedo ENTRY4 Robert Brown ENTRY2 Robert Nightingale ENTRY3 -------------- ModifyContainer ------------- Joe Smith ENTRY1 result is: 1 Marc Tuxedo ENTRY4 result is: 1 Robert Brown ENTRY2 result is: 1 -------------- PrintContainer ------------- Joe_CHG Smith_CHG ENTRY1 Marc_CHG Tuxedo_CHG ENTRY4 Robert Nightingale ENTRY3 Robert_CHG Brown_CHG ENTRY2 --------------

    Read the article

  • I have string with "\u00a0" and I need to replace it with "" str_replace fails

    - by 0plus1
    I need to clean a string that comes (copy/pasted) from various office suite (excel, access, word) each with his own set of encoding. I'm using json_encode for debugging purposes in order to being able to see every single encoded character. I'm able to clean everything I found so far (\r \n) with str_replace, but with \u00a0 I have no luck. $string = '[email protected]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0;[email protected]'; //this is the output from json_encode $clean = str_replace("\u00a0", "",$string); returns: [email protected]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0;[email protected] that is exactly the same, it completly ignores \u00a0. Is there a way around this also I'm feeling I'm reinventing the wheel, is there any function/class that completely strips EVERY possibile char of EVERY possible encoding? Thank you for your time. _EDIT_ After the first two replies I need to clarify that my example DOES work because it's the output from json_encode not the actual string! _EDIT_

    Read the article

  • Replace with wildcard, in SQL

    - by Jay
    I know MS T-SQL does not support regular expression, but I need similar functionality. Here's what I'm trying to do: I have a varchar table field which stores a breadcrumb, like this: /ID1:Category1/ID2:Category2/ID3:Category3/ Each Category name is preceded by its Category ID, separated by a colon. I'd like to select and display these breadcrumbs but I want to remove the Category IDs and colons, like this: /Category1/Category2/Category3/ Everything between the leading slash (/) up to and including the colon (:) should be stripped out. I don't have the option of extracting the data, manipulating it externally, and re-inserting back into the table; so I'm trying to accomplish this in a SELECT statement. I also can't resort to using a cursor to loop through each row and clean each field with a nested loop, due to the number of rows returned in the SELECT. Can this be done? Thanks all - Jay

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >