Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

167.Advanced search and replace -- How to remove/delete the text from the '#' to the end in each line?

User: editor -- 2008-05-31          << 166  168 >>
Hits: 2590
Type: Advanced search and replace   
Search all Advanced search and replace examples
How to remove the text from the '#' to the end in each line?
Input Sample:
line1    # comments1 
this is line 2  # comments2 
this is the 3rd line # comments3
Output Sample:
this is line 2   
this is the 3rd line  
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source file.      
2. ctrl-h open 'Replace' dialog,      
in 'Replace' window,    
* set 'Replace Scope' to 'Line'(means process by line)    
* fill in 'Search for Pattern': 
Note: .* means any 
* fill in 'Replace with Pattern':  
Note: means only keep a line break. 
3. click 'Replace', finish. 
Download Script:  scripts/

Screenshot 1:  Replace_Window

Similar Examples:
How to extract text from 'start' to 'end' in each line? (69%)
How to delete the same field in each line? (68%)
How to delete all text after the second comma in each line? (68%)
How to remove the text from line start to the first ":" in each line? (67%)
How to remove consecutive space and table keys at the end of each line? (67%)
How to remove/delete the characters between 5 and 15 of every line? (65%)
How to remove duplicate column in each line? (63%)
How to sort a text file by the length of text in each line? (63%)

Check Demo of Advanced search and replace
line break  break  process  keep  replace scope  scope  delete  delet  dele  fin  replace remove line break  remove break  remove line break  remove break line  remove from to end  remove line end  remove end with  remove line from