Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

239.Random word generator -- How to replace all digits into a random digit, but keep other letters in a text file?

User: editor -- 2008-08-02
Hits: 216
Type: Random word generator   
Search all Random word generator examples
Description:
How to replace all digits into a random digit, but keep other letters in a text file?
Input Sample:
This is mobile no 842-037-022
This is another mobile no 336-222-220
Output Sample:
This is mobile no 916-825-204
This is another mobile no 171-528-930
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'Replace' dialog.
* set "Search for pattern" to:

* set "Replace with pattern" to:

3. Click "Replace", done!
Note: rand(10) will generate a value between 0 to 10, int will truncate the value and keep integer part.
Download Script:  scripts/239.rst.zip

Similar Examples:
How to replace specific spaces into comma in each line of text file? (58%)
How to reverse all cases of letters in a text file? (56%)
How to extract all lines longer than 80 characters from a text file? (54%)
How to add one space before each digit of number in a text file, but ignore other letters? (54%)
How to replace all consecutive spaces and tabs into one single comma in text file? (53%)
How to replace the last occurance of some text like 'abc' to 'def' in a text file? (53%)
How to extract all telephone numbers from a text file? (52%)
How to remove/delete all single-byte characters in a text file (52%)

Check Demo of Random word generator