User: editor -- 2014-12-08 << 1268 1270 >> |
Hits: 2891 |
Type: Replace text in multiple files |
Search all Replace text in multiple files examples |
Description: |
How to apply my own shuffle algrithm on multiple files? |
Input Sample: |
# My algrithm to shuffle an array sub shuffle { my @array = @_; return unless @array; my $i = @array; while( --$i ) { my $j = int rand($i+1); @array[$i,$j] = @array[$j,$i]; } return @array; } |
Output Sample: |
There are multiple files. shuffle all lines for each files. |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. open "Settings->My Library" menu. 2. copy and paste the function to the editor window, and click "ok". 3. open "Tools->Batch Runner" menu. 4. drag your files(one or multiple) to "Batch Runner" window. 5. change "set output filename" entry to: so that the shuffle result will be saved to new file. 6. click "Fast Replace" button 7. click "add" to add new rules: * set "search" to be blank. * set "replace" to: 8. make sure "reg exp" and "cross line" options are checked. 9. click "start", done. |
Screenshot 1: Batch_Runner_Window |