| User: editor -- 2011-05-31 << 791 793 >> |
| Hits: 317 |
| Type: Text sort |
| Search all Text sort examples |
| Description: |
| How to sort the text by the number of specific word like 'YES' in each line? The lines with more 'YES' will have a high order, the line without 'YES' will have a lowest order. |
| Input Sample: |
| 1. YES NO YES NO 2. NO NO YES NO 3. YES YES YES YES 4. NO NO NO NO 5. NO YES YES YES |
| Output Sample: |
| 3. YES YES YES YES 5. NO YES YES YES 1. YES NO YES NO 2. NO NO YES NO 4. NO NO NO NO |
| 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' window * set 'replace with pattern' to: * click 'advanced' tab, define the sub-routine in 'run following at the beginning of replace' entry: 3. click 'Replace', done. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |