Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
223.Advanced search and replace -- How to change all numbers which have format of (number) to -number?
User:
editor -- 2008-07-14
<< 222
224 >>
Hits:
2720
Type:
Advanced search and replace
Search all
Advanced search and replace
examples
Description:
How to change all numbers which have format of (number) to -number?
Input Sample:
123 225 (39) 32
(603.3) 222 333 555
Output Sample:
123 225 -39 32
-603.3 222 333 555
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open the text file
2. ctrl-h open 'Replace' dialog
in 'Replace' page:
* set 'Search for pattern' to:
\([\d\.\s]+\)
* uncheck option [ ]Enhanced Regular expression
* set 'Replace with pattern' to:
-chars($match,2,-2)
3. Click 'Replace', done!
Note:
1. \([\d\.\s]+\) is a regular expression, will match any number enclosed by a pair of parenthesis.
2. Use standard Regular Expression, so uncheck [ ]Enhanced Regular Expression
3. chars($match,2,-2) means remove the first char '(' and last char ')' from matched text.
Download Script:
scripts/223.rst.zip
Screenshot 1: Replace_Window
Similar Examples:
How to change all numbers which have format of (number) to -number?
(100%)
How to change all negative numbers to the format of (number)?
(75%)
How to change all numbers in a text file to the comma separated numbers?
(62%)
How to change the numbering format in a text file to a new format?
(58%)
How to extract all numbers in a text file, and provide a summary of number at the end?
(56%)
How to convert all numbers from decimal to percentage?
(55%)
How to replace strings and numbers with new format in multiple files?
(53%)
How to sort file by the number which first appear in each line?
(53%)
Check Demo of
Advanced search and replace
Keywords:
enhanced regular expression
parenthesis
parenth
how to change all numbers
toc
nth
enclose
pare
all numbers
last
regular expression change format
expression regular remove number
regular expression replace numbers
replace enclosed expression
enclosed replace regular expression
regular expression replace enclosed
last numbers
regular expression replace last