Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

576.Advanced search and replace -- How to add sequence number for each non-blank line of a text file?

User: editor -- 2010-07-29          << 575  577 >>
Hits: 2789
Type: Advanced search and replace   
Search all Advanced search and replace examples
How to add sequence number for each non-blank line of a text file?
Input Sample:

printf "test"; 
Output Sample:
1 main() 
2 { 
3 printf "test"; 
4 exit; 
5 } 
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 
* set 'replace unit' to 'Line' 
* in 'search for pattern', enter: 
* in 'replace with pattern', enter: 
3. click 'Replace', done!

Screenshot 1:  Replace_Window

Similar Examples:
How to remove the sequence number before each line of text file? (75%)
How to add line_no before each line of a text file? (71%)
How to add a page number after every 40 lines in a text file? (67%)
How to delete the first word in each line in a text file? (65%)
How to add sequence number for duplicated line? (64%)
How to count number of each intial letters in all words in text file? (64%)
How to change the number in each line to specified order in a text file? (63%)
How to add a single space after each character in a text file? (63%)

Check Demo of Advanced search and replace
add sequence number  add sequence  sequence number  non  blank line  blank  sequence  seq  enter  number  sequence number of each line in a text file  search and replace add sequence  sequence number text file  replace text sequence number  replace text to sequence number  replace with sequence number  replace with number sequence  replace sequence number