w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
In NotePad++ find and replace, how would I use what I found in my replace?
Enclose it in parentheses in your find. request.POST[("[a-z A-Z _]*")] Then use 1 in your replace. That will return what was captured by the first set of parentheses. (Use 2, 3, etc. if you have multiple capturing groups.

Categories : Regex

Notepad++ range replace
You might be able to leverage regular expressions. The range limitation makes it more difficult, but with 2 different replaces, I think we can manage it. (The complication comes from the fact you don't want to replace values like 900.4.3.) Back up your file, just to be safe. Open the Replace dialog, and change Search Mode to "Regular expression". Enter birth_date="[678]dd.d+.d+" in "Find what:". Enter birth_date="451.1.1" in "Replace with:" Press Replace All. Change "Find what:" to birth_date="900.1.1". Press Replace All. Then check to make sure it did what you wanted. A differencing tool might be helpful there. (You can compare the modified file with the back up.) The two different regexes are necessary because of the range. The first one catches anything starting with 6, 7, or 8 plu

Categories : Python

Notepad++ How to replace everything in between certain lines
Regex is your friend. Ctrl-H (Find/replace) and enable regular expressions (bottom left of dialog). {s*}$ replace with: { whatever you want } Regex Match Explanation: {} are reserved, so escaping them will match the actual brace character s of course will match all whitespace (including new lines and tabs) $ would be the end of the line; this just helps the match in the replace would insert new lines where it makes sense; these are optional.

Categories : Regex

Using Regex in Notepad++ to Replace a Character
There are two options. You could use capturing and write back what you matched (in addition to the quotes): ([a-zA-Z0-9]{16},)([a-zA-Z]+) Each set of parentheses generates a captured group. You can reference what they matched with $n in the replacement string: $1"$2. Note that there is no need to escape the comma. The alternative is lookarounds. What you match inside a lookaround is not part of the match, so it doesn't get removed. If you put everything around the desired position in lookarounds, you'll match a position instead of a string, and the replacement string will simply be inserted in that position: (?<=[a-zA-Z0-9]{16},)(?=[a-zA-Z]+) And replace that with ". In any case, make sure to upgrade to Notepad++ 6. Finally note that in both cases the + at the end is irreleva

Categories : Regex

Notepad++find/replace regex
I think something like this should work. It's not tested, though. Find: ^d{5}) + d{4}:d pushstring "(.*)"$ Replace: http://static-0.farmville.zgncdn.com/1

Categories : Misc

Regular expression for Notepad++ to replace this?
I believe this should work: [0-9]+</td><tdswidth="8%">2 If you editor supports groupped editing, use paranthesis to mark each group then edit the one you need. Groupped version: ([0-9]+)(</td><tdswidth="8%">)(2)

Categories : Regex

How to use regex to replace text between tags in Notepad++
A regular expression to return "the thing between <pre><code> and </code></pre>" could be /(?<=<pre><code>).*?(?=</code></pre>)/ This uses lookaround expressions to delimit the "thing that gets matched". Typically using regex in situations with nested tags is fraught with danger and you are much better off using "real tools" made specifically for the job of parsing xml, html etc. I am a huge fan of Beautiful Soup (Python) myself. Not familiar with Notepad++, so not sure if its dialect of regex matches this expression exactly.

Categories : Regex

Mass Replace differetent word using notepad ++
Search for <esi:include src=([^/]*)/> and replace with <!--#include virtual=$1--> You can capture parts you want to reuse by putting round brackets around, that is called a capturing group. You can then insert them in the replacement string by adding $x, where x is the number of the capturing group. The groups are numbered by the opening brackets.

Categories : Regex

Notepad++ v6.3.2 backreference regex replace not working
You must understand that $n refer to the capturing group number n. Since you don't have capturing groups in your search pattern, the group number 1 doesn't exist: You must use capturing parenthesis to define a group, example: search: (&lt;header) replace: $1 class="bold" Another example: search: (&lt;)(header) replace: $1$2 class="bold" Notice: $0 refers to the whole match (without define any capturing group). Then you can write: search: &lt;header replace: $0 class="bold"

Categories : Regex

Conditional statement for find and replace in Notepad++ or any text editor
You can do that using Regular Expressions. Use the regex below at the Find what: field: <Coverage>s*(1[0-4]|[0-9])?[0-9]?[0-9]?[0-9]?[0-9]s*</Coverage> And Replace with: <Coverage>150000</Coverage> This will replace every <Coverage>number</Coverage> string where the number is smaller than 150000. Check this online demo. The blue text is what will be matched and replaced. Do some tests, write some examples and make sure it matches what you expect. Usage on Notepad++: Make sure you check the Regular Expression radio in the Search mode box. Check an example below.

Categories : Xml

How to store regex match in a variable to use with Search/Replace in Notepad++
Yes, $& or $0 represents the entire match in the replacement string: Find what: .*?(?=[ ]) Replace with: INSERT INTO table (value) VALUES ("$0") Note that you don't need the quotes inside the character class. Otherwise your match will stop at a quote as well. Also note, that there is another catch, that you have to escape parentheses in the replacement string (thanks to acdcjunior for noticing that). That's because Notepad++ uses boost, which supports a parenthesis-delimited conditional construct. Using your input, this will result in INSERT INTO table (value) VALUES ("ab") iiids INSERT INTO table (value) VALUES ("as") sasas INSERT INTO table (value) VALUES ("md") aisjaij INSERT INTO table (value) VALUES ("as") asijasija For more advanced use cases, you can wrap parts of the reg

Categories : Regex

Notepad++ regex - howto replace all underscores, which follow a = sign?
Make a find of: (=[A-Za-z]*)_ And replace it with: $1 [Note: there is a space after the $1] Be sure to check the 'Regular expression' mode, and click replace all. Sometimes, you need to select all first (when your cursor is at the end and you have 'Find Down' checked for instance) I'm assuming there are only alphabets between the equal sign and the underscore you want to remove.

Categories : Regex

Counting delimiter in String and splitting the other character between the delimiter in SQL Server using loop
I think this will do the job. while @index1 < LEN(@symbol) begin set @index2 = CHARINDEX(',',@symbol,@index1) set @op = substring(@symbol,@index1,@index2-@index1) print @op set @index1 = @index2+1 end

Categories : Sql Server

How to replace word in notepad++ that begins with certain word plus number of bytes
2013d{10} will match 2013 and 10 digits after it. UPD: Here's a slightly improved version of the regex: 2013[0,1][0-9][0-3][0-9][0-2][0-9][0-5][0-9][0-5][0-9] that will still match, for example, 20130601000000 because it's a valid timestamp.

Categories : Regex

Removing text between "|" delimiter and "," delimiter using shell script
Try sed: sed "s/|[^,]*//g" Result: h2co3-macbook:~ h2co3$ echo "name,title,email1|email2|email3,phone,address" | sed "s/|[^,]*//g" name,title,email1,phone,address h2co3-macbook:~ h2co3$

Categories : Regex

Retrieve data from a database and separate the data when we get a delimiter?
in javascript: var newcol2 = oldcol2.replace(/;/, " "); or var arycol2 = oldcol2.split(';'); in php: $newcol2 = str_replace(";", " ", $oldcol2); or $arycol2 = explode(';', $oldcol2); references: explode and str_replace from the php manual.

Categories : PHP

Split at multiple delimiter without delimiter in the list
As arshajii points out, you don't need groups at all for this particular regexp. If you did need groups to express a more complex regexp, you could use noncapturing groups to split without capturing the delimiter. It's potentially useful for other situations but syntactically messy overkill here. (?:...) A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern. http://docs.python.org/2/library/re.html So the unnecessarily complex but demonstrative example here would be: re.split(r'(?:[|])', data2)

Categories : Python

Accessing data of notepad
An alternative to a simple load is to use fscanf or textscan, as in fid=fopen('accessing_data_of_notepad.txt') dat = textscan(fid,'%s') fclose(fid) Your data will be in cell array dat. You can modify the format specifier to suit your needs, for instance if you want all of the numbers you can use something like fid=fopen('accessing_data_of_notepad.txt'); dat = textscan(fid,'%d %d:%.3f %d:%.3f %d:%.3f') fclose(fid); Values 0.009 0.056 6.009 will be in dat{3}, dat{5} and dat{7}

Categories : Matlab

Delimiter extracting out a range of data
Plase, read that: Parsing and adding string to vector. You just have to change the delimiter (from whitespace to :). std::ifstream infile(filename.c_str()); std::string line; if (infile.is_open()) { std::cout << "Well done! File opened successfully." << std::endl; while (std::getline(infile, line, ':')) { std::istringstream iss(line); std::vector<std::string> tokens{std::istream_iterator<std::string>(iss),std::istream_iterator<std::string>()}; // Now, tokens vector stores all data. // There is an item for each value read from the current line. } }

Categories : C++

Column Delimiter while exporting data from table using expdp - oracle
As I see the docs: Oracle® Database Utilities 11g Release 2, expdp is unable to do formatting. But you can use external tables for database unloads. First you should create a directory: CREATE DIRECTORY mydir AS 'C:MyDir' Then grant access to it: GRANT READ, WRITE ON DIRECTORY mydir TO myuser; Finally in one step create an external table and export the result of a query into it: create table mytable ( col1 varchar2(100), col2 varchar2(100) ) organization external ( type oracle_loader default directory mydir access parameters ( records delimited by newline fields terminated by "#|" ) location('myfile.txt') ) as select col1, col2 from anothertable; Here is a good link to read more details about external tables: Oracle® Database Administrator's Guide 11g R

Categories : Oracle

Extract values from a comma delimited file when delimiter is coming in data itself
The following solution assumes that you have a character that doesn't appear in the input. Say the character | doesn't appear in file1.dat, then the following would yield the desired result: $ sed "s/,',/,'|/" file1.dat | cut -d, -f1-4 --output-delimiter=$' ' | tr '|' ',' 'Data1' 'DataA' ',' 'Data2' 'DataB' 'X' 'D'

Categories : Shell

MS Office - How bind some parts of document to custom XML data and then replace this data via .NET?
There is support for repeating content controls in Word 2013 (Target namespace: http://schemas.microsoft.com/office/word/2012/wordml); see repeatingSection in [MS-DOCX] For approaches which don't require Word 2013, Google "repeatingSection openxml sdk" or some such. As a solution to this problem, I documented a standardised approach, and named it OpenDoPE. You can build your own support for this way of doing it using the OpenXML SDK, or you could IKVM docx4j. In essence, you need to create the table rows, and in each, make a content control bound to the corresponding entries in your collection.

Categories : C#

Macro to find data from cell and replace data on different sheet
If you don't do anything with the name in sheet1!b1, you can pull the corresponding value from sheet2!b1 to sheet1!b1 using the VLOOKUP function. In Sheet1 Cell B1, enter the formula below. =VLOOKUP(A1,Sheet2!A:B,2,FALSE) Then you can enter your number on sheet1!A1, the corresponding value from sheet2!b2 should display on sheet1!b1. If there's no matching found, you will get the #N/A.

Categories : Excel

Find Replace variable data with common tag data
Try this: find: Figure: (S+) replace: (<internalRef internalRefId="$1"internalRefTargetType="figure"></internalRef>) The parenthesis in the pattern are used to capture the content (S -> all that is not a space), then you can refer to it in the replacement pattern with $1. Figure: that is not captured is removed

Categories : Regex

JQuery Replace "Special" Function (like replace(/#[^#]*$/, "") replace(/?[^?]*$/, ""))
They are called regular expressions. Regular expressions are patterns used to match character combinations in strings

Categories : Jquery

Replace data in CFC
<cffunction name="test" access="remote" returnformat="json" output="false"> <cfquery datasource="#dns#" name="local.rs.q" maxrows="5"> select replace(text, "/webimages/", "http://domain.com/webimages/") as text from table </cfquery> <cfreturn rs.q> </cffunction> or <cffunction name="test" access="remote" returnformat="plain" output="false"> <cfquery datasource="#dns#" name="local.rs.q" maxrows="5"> select text from table </cfquery> <cfreturn replace(serializeJSON(rs.q), "/webimages/", "http://domain.com/webimages/", "all")> </cffunction>

Categories : Json

I have uploaded application with core data and I want to replace new core data without migration. Does apple allows it?
Apple won't care, but your users might. If there is data that your users might be sorry to lose, you should make every effort to migrate it or give an option to export it when they upgrade. If you're only using core data to cache downloaded values, then there's no problem with this at all. In fact, deleting the old store would be necessary to prevent the app crashing on upgrade, since it wouldn't be able to migrate from the existing store. The best place to do this is in the core data setup code when you receive an error - the boilerplate comments guide you toward this.

Categories : IOS

Replace data in a PDF file
Please read the intro of chapter 6 of my book. You're assuming that PDF is a format for editing text. PDF wasn't designed for word processing. Of course: maybe you're asking how to create a static form as explained in section 6.3.5 of my book, but I doubt the static nature of AcroForm technology will meet your needs. A pure XFA form (dynamic PDF) may solve your problem, but explaining XFA isn't something that can be done within the scope of an answer on SO. The XFA spec is several hundreds of pages long. As indicated in the comments by Duncan Jones, you should first do some preliminary work.

Categories : Java

How to use replace existing data in row?
In the Edit form, you need a hidden-field with the ID. Is "Title" the ID, or is there a separate ID column? In the SQL, depending on whether ID or TITLE is your key, you need: update INTRODUCTION set TITLE=?, DESCRIPTION=? where ID=? update INTRODUCTION set TITLE=?, DESCRIPTION=? where TITLE=? -- set new title, WHERE previous title If you insist on using non-prepared statements (vulnerable to SQL injection), make sure you filter or sanitize the values going into your SQL statement. See: What are the best PHP input sanitizing functions? UPDATE Introduction SET Title='value', Description='value' WHERE ID=id Unfiltered values from the web into SQL allow attackers to hack or destroy your database with trivial ease.

Categories : PHP

Does SQLite data retain after replace the app
When an app is upgraded, any data files created by the app are not affected. When SQLiteOpenHelper detects that the database file's version is smaller than the version declared by your app, it calls onUpgrade.

Categories : Android

How to replace NaN value with zero in a huge data frame?
The following should do what you want: x <- data.frame(X1=sample(c(1:3,NaN), 200, replace=TRUE), X2=sample(c(4:6,NaN), 200, replace=TRUE)) head(x) x <- replace(x, is.na(x), 0) head(x)

Categories : R

Replace All data in the table with relationship
You could do a update from the ContactBAK table using a join approach. If the records are essentially the same with a few fields modified, this should work. For example: UPDATE c SET c.FirstName = bak.FirstName FROM Contacts c LEFT JOIN ContactsBAK bak ON c.ContactID = bak.ContactID You'll have to modify the fields you want to update and match on the joins of course.

Categories : Sql Server

Massive content replace on php data
You can use str_replace with first parameter as search array and second parameter as replace array. $arr = array("###123###","###456###","###789###"); $arr1 = array("hello","great","ok"); str_replace($arr,$arr1, $data);

Categories : PHP

When statment to replace Null data
Try: SELECT IsNull(money, 0) FROM mytable EDIT If you want to replace the values in the table: UPDATE mytable SET money = 0 WHERE money Is Null

Categories : Sql Server

if data is string type replace to '0' for Column
I created function and it is working fine. i am uploading my function for future reference CREATE FUNCTION dbo.udf_GetNumeric_Nitish (@strAlphaNumeric VARCHAR(256)) RETURNS VARCHAR(256) AS BEGIN declare @test varchar(256) declare @intAlpha int select @intAlpha = ISNUMERIC(@strAlphaNumeric) if @intAlpha=1 set @test=@strAlphaNumeric else set @test='0' RETURN @test END

Categories : SQL

How to replace a column data in linux output - may be using awk sed etc
$ cat foo.input drwxrwxr-x 2 root root 5512 Aug 22 2013 bin lrwxrwxrwx 1 root root 7 Aug 22 2013 bin/addgroup -> busybox lrwxrwxrwx 1 root root 7 Aug 22 2013 bin/adduser -> busybox lrwxrwxrwx 1 root root 7 Aug 22 2013 bin/ash -> busybox $ cat foo2.input drwxrwxr-x 2 root root 0 Aug 22 09:32 bin lrwxrwxrwx 1 root root 7 Aug 22 09:24 bin/addgroup -> busybox lrwxrwxrwx 1 root root 7 Aug 22 09:24 bin/adduser -> busybox lrwxrwxrwx 1 root root 12345 Aug 22 09:24 bin/ash -> busybox $ diff <(awk '/^d/{$5=0}{$6=$7=$8=""}1' foo.input) <(awk '/^d/{$5=0}{$6=$7=$8=""}1' foo2.input) 4c4 < lrwxrwxrwx 1 root root 7 bin/ash -> busybo

Categories : Linux

how to replace multiple factors in whole data.frame in R
You could use function mapvalues() from library plyr(). As you want to do this this with multiple columns then you can use also function sapply(). This solution works if all columns in your data frame are factors. library(plyr) xx<-as.data.frame(sapply(tata, mapvalues, from = c("deb", "joy"), to = c("XXX", "XXX")))

Categories : R

to replace a word from data accessed from file
You should use available API for this solution. Apache Commons_IO is the best for file handling . See the example for your question. This will convert any "Bond" string in the file with "Hound" and write it back to the file. This will over-write it. More information Apache Commons IO package com.test; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; public class TestFile { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { File file = new File("d:/test.txt"); String input = FileUtils.readFileToString(file); String output = input.replaceAll("Bond", "Hound"); FileUtils.write(file, output); } }

Categories : Java

Automatically replace names in data frame
arcs<-structure(list(col1 = structure(c(4L, 1L, 2L, 3L, 5L), .Label = c("blah 2", "blah 3", "blah 4", "data 1", "data 4"), class = "factor"), col2 = structure(c(1L, 3L, 4L, 2L, 5L), .Label = c("blah 1", "blah 5", "data 2", "data 3", "data 5"), class = "factor")), .Names = c("col1", "col2"), class = "data.frame", row.names = c(NA, -5L)) > arcs col1 col2 1 data 1 blah 1 2 blah 2 data 2 3 blah 3 data 3 4 blah 4 blah 5 5 data 4 data 5 data2<-structure(list(oldname = structure(1:5, .Label = c("data 1", "data 2", "data 3", "data 4", "data 5"), class = "factor"), newname = structure(1:5, .Label = c("real 1", "real 2", "real 3", "real 4", "real 5"), class = "factor")), .Names = c("oldname", "newname"), class = "data.frame", row.names = c(NA, -5L)) > data2 oldname new

Categories : R

RegEx Notepad++
I suggest a two step approach. First get all the lines with the STNO and a number. Second remove everything except the number. Select the Mark tab in the find dialogue. Ensure Bookmark line is ticked. In the Find what box enter STNO:s*d+ and then click Mark all. Access Menu => Search => Bookmark => Copy bookmarked lines. Then paste into another buffer. Alternatively, to work in the same file use Menu => Search => Bookmark => Remove unmarked lines. Now you should have all the wanted lines in a buffer. Do a regular expression search and replace setting Find what to be ^.*STNO:s*(d+).*$ and Replace with to 1. Then click Replace all. The above assumes that there is only one number to be found per line. ========================= As only the numbers are wanted, another method would be to p

Categories : Regex



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.