User: editor -- 2010-01-31 << 407 409 >> |
Hits: 3014 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
How to convert the daily data into a weekly with perl program? I want to combine data rows in groups equal to weeks, all weeks except the first week must have 5 days, 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 |
Output Sample: |
03/04/09 00:00 2.67 2.98 2.44 4466900 2.59 03/11/09 00:00 2.92 3.60 2.50 3753080 3.12 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. ctrl-o open source text file 2. ctrl-h open 'Replace' dialog * set "Replace with Pattern": * click 'Advanced' page, enter 'Run following for each matched unit': 3. click 'Replace', done 4. ctrl-s save file. |
Download Script: scripts/408.rst.zip |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |