Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
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:
4063
Type:
Advanced search and replace
Search all
Advanced search and replace
examples
Description:
How to add sequence number for each non-blank line of a text file?
Input Sample:
main()
{
printf "test";
exit;
}
Output Sample:
1 main()
2 {
3 printf "test";
4 exit;
5 }
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
* set 'replace unit' to 'Line'
* in 'search for pattern', enter:
[^\s]
* in 'replace with pattern', enter:
$line_no $match\n
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
Keywords:
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