Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

483.Advanced search and replace -- How to search specified pattern in a text file and remove spaces in it?

User: Luiz -- 2010-04-19          << 482  484 >>
Hits: 348
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace like this :
In the original .txt : PRICE=2 3 4 5 (OR PRICE=3 2 5 6 , Any number)
Type to find in the .txt all sentences like this : PRICE=X X X X
Replace with : PRICE=XXXX
Replaced .txt : PRICE=2345 (OR PRICE=3256)

In the original .txt : PRICE=Q J K
Find : PRICE=Y Y Y
Replace with : PRICE=YYY
Replaced .txt : PRICE=QJK

So basically,
USE X to find numbers and Y to find LETTERS.
But replace them with the correspondent number.
How can I do that
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' window
* in 'search for pattern' entry, input:

* in 'replace with pattern' entry, input:

3. click 'replace' button, done!

P.S. If you want to use X to find Number, use Y to find Letters, you can use \d in place of X, use [A-Za-z] to replace Y.
You can write like: PRICE=\d \d \d, PRICE=[A-Za-z] [A-Za-z] [A-Za-z] [A-Za-z]
Download Script:  scripts/483.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to keep all specified words in an article and remove rest words? (63%)
How to search and sum the numbers at specified position in a text file? (62%)
How to save specified lines of text file into different files? (62%)
How to extract all specified date format from a text file? (60%)
How to exract specified strings started with www from text file? (59%)
How to batch extract specified lines from a text file? (59%)
How to remove some specified characters from multiple filenames? (57%)
How to shuffle specified lines in multiple text files? (57%)

Check Demo of Advanced search and replace
Keywords:
asic  price  sentences  sentence  remove spaces  remove space  letters  spaces  type  find  remove sentences find and replace  find and replace all numbers  remove numbers  remove txt  remove specified  find and replace text with a  write to file  find pattern in file replace