Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

171.Advanced search and replace -- How to delete the first word in each line in a text file?

User: editor -- 2008-06-02          << 170  172 >>
Hits: 658
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to delete the first word in each line in a text file?
Input Sample:
1 line1
2 this is line2
3 line3
4 line4
5 line5
6 line6
7 line7
8 line8
9 line9
10 line10
11 line11
Output Sample:
line1
this is line2
line3
line4
line5
line6
line7
line8
line9
line10
line11
Answer:
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 Unit' to 'Line'
* fill in 'Search for Pattern':     

* fill in 'Replace with Pattern': 
 
3. click 'Replace', finish.   

Notes: words($match,2,-1," "," ") means the words from second to last one. Use " " as input delimiter and output delimiter.
Download Script:  scripts/171.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to replace each xxx with the first word in the same line in text file? (77%)
How to remove the first 10 characters of each line in text file? (75%)
How to reverse all the words in each line of a csv file? (74%)
How to delete duplicate lines of a text file? (74%)
How to reverse the order of all the lines in a text file? (73%)
How to add line_no before each line of a text file? (71%)
How to batch remove/delete first and last line of many text files? (70%)
How to delete the first 1-10 lines in many files?  (69%)

Check Demo of Advanced search and replace
Keywords:
delete the first  first word  second  delimiter  last  input  las  how to delete  delete  dele  delete first word from each line  second last line  delete the last word for each line  delete first word in each line  delete first word  delete last line  replace the last word for each line  each line last word