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
1421.Advanced search and replace -- How to caculate the last day of a month?
User:
jiangnan -- 2018-09-13
<< 1420
1422 >>
Hits:
2003
Type:
Advanced search and replace
Search all
Advanced search and replace
examples
Description:
How to caculate the last day of a month?
Input Sample:
201701
201602
201702
Output Sample:
20170131
20160229
20170228
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open source file
2. ctrl-h open 'replace' dialog
* set 'search for pattern' to:
\b(\d\d\d\d)(\d\d)\b
* set 'replace with pattern' to:
$1$2scalar(((31,!($1%4)&&($1%400)?29:28,31,30,31,30,31,31,30,31,30,31))[$2-1])
3. click 'replace', done.
Note: !($1%4)&&($1%400)?29:28 is 29 for leap year, 28 for normal year.
Screenshot 1: Replace_Window
Similar Examples:
How to calculate sum value of every column?
(58%)
How to calculate Williams %R from stock data?
(58%)
How to calculate the average of the numbers in the same column?
(57%)
How to calculate the sum of the numbers in the same column?
(57%)
How to calculate the average of numbers of one column?
(56%)
How to calculate the percentage of the number in the column1?
(56%)
How to calculate the total energy consumption in group?
(54%)
How to calculate the absolute average value of every 2 columns?
(54%)
Check Demo of
Advanced search and replace
Keywords:
year
month
scalar
day
nth
the last
last
las
cal
open sou
replace last
search and replace open source
search pattern
replace pattern
1 2 3 2 3 4 3 4 1 1 4 1
search replace
search file
search 2