Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

164.Advanced search and replace -- How to add one space before each digit of number in a text file, but ignore other letters?

User: editor -- 2008-05-29
Hits: 220
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to add one space before each digit of number in a text file, but ignore other letters?
Input Sample:
0123456789 abcde
dfdfdd 234567844
2222222222 www
Output Sample:
0 1 2 3 4 5 6 7 8 9 abcde
dfdfdd 2 3 4 5 6 7 8 4 4
2 2 2 2 2 2 2 2 2 2 www
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
It's quite easy! 
1. ctrl-o open source file.  
2. ctrl-h open 'Replace' dialog,  
in 'Replace' window,   
* fill in 'Search for Pattern':  

Note: \d means one digit 
* fill in 'Replace with Pattern': 

Note: ' $match' means add a space before each found digit.
3. click 'Replace', finish.
 
Download Script:  scripts/164.rst.zip

Similar Examples:
How to add line_no before each line of a text file? (60%)
How to replace all digits into a random digit, but keep other letters in a text file? (55%)
How to convert each line of a text file to the new format? (54%)
How to add some spaces at the beginning of each line to align the text to the center in a pure text file. (54%)
How to add SH before each number, and remove/delete quota "'"? (54%)
How to add 3 spaces after every 9 characters in a text file? (53%)
How to sort the lines in a text files by the order of line length? (52%)
How to replace words in a text file only if they are whole words? (51%)

Check Demo of Advanced search and replace