Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

405.Random word generator -- How to replace all the password field in text file with random chars?

User: editor -- 2010-01-27
Hits: 141
Type: Random word generator   
Search all Random word generator examples
Description:
How to replace all the password field in text file with random chars?
We have a text file which has password field, How can I change the password field to a word with 12 byte random chars of 0-9, a-z?
Input Sample:
id=0001
user=user1
pass=xxxx

id=0002
user=user2
pass=yyyy

id=0003
user=user3
pass=zzzz
...
Output Sample:
id=0001
user=user1
pass=y9oage475hn

id=0002
user=user2
pass=0v2ke9yv67b

id=0003
user=user3
pass=st1q0abjnn0
...
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
* in 'search for pattern', enter:

* in 'replace with pattern', enter:

3. click 'Replace', done!
4. ctrl-s save text file

The syntax of rand_str:
=> Select N elements from str1 to strM randomly, and join them to a string, string will be joint by <CR> if N is negative'

For more function explanation, please check following link or online help:
http://www.mind-pioneer.com/replace/help/Functions.html
Download Script:  scripts/405.rst.zip

Similar Examples:
How to replace all the numbers in a text file to the square value? (65%)
How to sort all the lines of a text file randomly? (64%)
How to replace a string in one text file with random words from another file? (62%)
How to change all the letters in a text file to upper cases? (61%)
How to replace words in a text file only if they are whole words? (61%)
How to extract all IP address from a text file? (59%)
How to reverse a text file by characters? (59%)
How to replace adjacent multiple spaces in a text files into one tab? (57%)

Check Demo of Random word generator