Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1241.Replace text in multiple files -- How to shuffle all paragraphs and remove all paragraphs with less than 30 words?

User: yong -- 2014-09-03          << 1240  1242 >>
Hits: 1109
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
I have a lots of text articles, i want to shuffle all of the Paragraph,4-7 paragraph per article, if the Paragraph less than 30 words, then delete this paragraph. please see the text sample, thanks!
Input Sample:
text 1:

Paragraph 1

Paragraph 2

Paragraph 3

Paragraph 4

Paragraph 5

Paragraph 6

text 2:

Paragraph 7

Paragraph 8

Paragraph 9

Paragraph 10

Paragraph 11

Paragraph 12

text 3:

Paragraph 13

Paragraph 14

Paragraph 15

Paragraph 16

Paragraph 17

Paragraph 18
Output Sample:
text 1:

Paragraph 17

Paragraph 12

Paragraph 3

Paragraph 4

Paragraph 9

Paragraph 6

text 2:

Paragraph 13

Paragraph 8

Paragraph 2

Paragraph 10

Paragraph 11

Paragraph 1

text 3:

Paragraph 9

Paragraph 4

Paragraph 15

Paragraph 16

Paragraph 11

Paragraph 8
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" menu
2. drag multiple text files to "Batch Runner" window
3. click "Fast Replace" button
4. click "Add" to add new rules:
* leave "search" to be blank
* set "replace" to:

* click "ok".
5. make sure "reg exp" option is checked, and click "start", done.

Note: Here, a "Pararaph" is defined to be some text followed by at least one blank line.
If you want to shuffle all lines instead of "Paragraph", set "replace" to:


Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to remove all paragraphs(lines) that only contain single sentence? (53%)
How to sort randomly(shuffle) all paragraphs that separated by ## in multiple files? (52%)
How to keep all specified words in an article and remove rest words? (50%)
How to extract all paragraphs matching "spanning-tree" and remove the match line? (48%)
How to sort paragraphs base on the second word in each paragraph? (48%)
How to remove all the lines that do not contain any of words in a list? (48%)
How to remove all lines that contains more than one word? (48%)
How to delete/remove all lines that appearred more than once? (47%)

Check Demo of Replace text in multiple files
Keywords:
shuffle all lines  rar  shuffle  paragraphs  leave  grep  less  scalar  tea  unique  delete paragraphs  split and remove blank line  shuffle files  split article  paragraph defined  delete line paragraph  delete paragraph  remove paragraphs