Advanced Search and Replace

replace_demo  Replace_text_in_multiple_files 
Advanced Search and Replace Features:
* Supports regular expression and multiple line search and replace
* Can search and replace text in multiple files
* Can add,delete,insert text or cut and reorganize the matched strings
* Can apply variables like "line_no" or "word_no" on the matched strings
* Can apply functions like "reverse","uc(uppercase)","sort" on the matched strings
* Can replace whole word,line or paragraph that containing searched strings
* Can make multiple search and replace in one time by providing multiple rules
* Every operation is automatically recorded into script, can modify and re-use

Column Exchange - Advanced Search and Replace

Example

Reverse order the 2,3,4,5 words of each line.

Advanced search and replace

Procedures:

1) ctrl-o open source text file

2) ctrl-h open 'replace' dialog

3) set 'Replace Unit' to 'Line'

4) set 'Replace with pattern' to '$match[1,5,4,3,2,6..]'

5) click 'Replace', the column 1,2,3,4,5,6 will be changed to 1,5,4,3,2,6


Line Merge - Advanced Search and Replace

Example

Join every 3 lines into one line

Advanced search and replace

Procedures:

1) ctrl-o open source text file

2) ctrl-h open 'replace' dialog

3) set 'Unit number filter' to '!3<3>'

4) set 'Search for pattern' to '\n'(\n means newline)

5) set 'Replace with pattern' to nothing

6) click 'Replace', all line breaks except 3,6,9,12,... will be removed

Notes:

3<3> means 3,6,9,12,...(start from 3, step is 3).

!3<3> means 1,2,4,5,7,8,10,11,(not 3,6,9,12,15,...)

Advanced Text Sort - Advanced Search and Replace

Example

Sort all lines by the value of second word

Procedures:

1) ctrl-o open source text file

2) ctrl-h open 'replace' dialog

3) set 'Replace with pattern' to "sort_by_word($match,2,2,'num')"

4) click 'Replace', all lines will be sorted by the value of second word

Example

Sort all words by the length

Procedures:

1) ctrl-o open source text file

2) ctrl-h open 'replace' dialog

3) set 'Replace with pattern' to "join(' ',sort { length($a)<=>length($b) } split(' ',$match))"

4) click 'Replace', the text will be sorted by the value of second word

Notes:

For batch replace files, please refer to Replace Pioneer help manual.


Other Examples of "Advanced search and replace"
How to highlight words appeared in same line in another file?
How to replace words to their original form in a passage?
How to count original form of words in a passage?
How to delete rows in csv based on criteria of specified column?
How to delete rows in csv based on criteria of some column?
How to change a file with special format to csv?
How to sort specified items descendingly in each line?
How to find numbers in specified location and sort them?

Search all "Advanced search and replace" examples