Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

363.Advanced search and replace -- How to convert the daily data into a weekly data in many text files?

User: editor -- 2009-12-09          << 362  364 >>
Hits: 3160
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
I want to combine data rows in groups equal to weeks such that a month is made of four groups or weeks. I would accept dividing each month into 4 groups. 
Where the date is the first date of the week series. 
And the output file should look like a daily file where space  
is concerned 
 
OPEN is the Average of all data rows  
HIGH is the Maximum value from the data rows  
LOW is the minimum value from the data rows  
VOLUME and CLOSE are the Average value
Input Sample:
03/02/09 00:00 2.91 2.98 2.54 2845000.00 2.54 
03/03/09 00:00 2.60 2.64 2.44 3036900.00 2.46 
03/04/09 00:00 2.51 2.84 2.47 7518800.00 2.78 
03/05/09 00:00 2.71 2.71 2.50 2468700.00 2.56 
03/06/09 00:00 2.58 2.91 2.56 2962900.00 2.89 
03/09/09 00:00 2.63 3.59 2.52 3380300.00 3.03 
03/10/09 00:00 3.19 3.59 3.05 7604400.00 3.58 
03/11/09 00:00 3.48 3.60 3.41 2349100.00 3.55 
03/12/09 00:00 3.48 4.00 3.34 3568800.00 3.93 
03/13/09 00:00 3.96 4.19 3.87 1985000.00 4.01 
03/16/09 00:00 3.99 4.38 3.99 
Output Sample:
DATE OPEN HIGH LOW VOLUME CLOSE 
03/02/09 00:00 2.66 2.98 2.44 3766460 2.65 
03/09/09 00:00 3.35 4.19 2.52 3777520 3.62 
03/16/09 00:00 4.17 4.61 3.60 2712540 4.09 
03/23/09 00:00 4.18 4.93 3.63 2821240 4.35
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open txt file 
2. ctrl-h open 'replace' window 
*set "Replace Unit" to "Line" 
*set "Replace Scope" to "Paragraph" 
*set "Replace with Pattern":  
--click 'Setting' page: 
*in 'Paragraph delimiters' frame, Check option of "fixed para lines", and enter "5,5,5,5,5,5,5,4.." at right(week 1 has 5 days, week2 has 5 days ..) 
--click 'Advanced' page: 
*set "Run following for each matched Unit": 
 
*set insert end text: 
 
3.click replace,done!(for multiple files, click "Batch ..." and pick files)
Download Script:  scripts/363.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to convert the daily data into a weekly data with program? (81%)
How to convert the data into a table with columns? (64%)
How to convert binary data in many text file to hexdecimal data? (63%)
How to extract all email addresses from many text files? (60%)
How to convert columns of data into SQL statement for mysql database? (59%)
How to count and sort the frequency of all words appeared in many text files? (59%)
How to join every n lines into 1 line in a text file? (59%)
How to add specified text to the begin and end of many text files? (59%)

Check Demo of Advanced search and replace
Keywords:
delimiters  weekly  paragraph delimiters  week  minimum  series  paragraph delimiter  paragraphs  mad  combine  replace with delimiters  replace delimiters  convert daily data weekly  convert daily data to weekly data  combine lines  combine text files  insert text in many files  insert multiple lines into text file