Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

281.Advanced search and replace -- How to delete all text after the second comma in each line?

User: editor -- 2008-10-14          << 280  282 >>
Hits: 478
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to delete all text after the second comma in each line?
Input Sample:
a1,a2,a3,a4 ...
b1,b2,b3,b4 ...
c01,c02,c03,c04 ...
...
Output Sample:
a1,a2
b1,b2
c01,c02
...
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 'Replace with Pattern': 
 
3. click 'Replace', finish.   

Notes: words($match,1,2,",",",") means take word1 and word2 from $match. Use "," as input delimiter and output delimiter.
Download Script:  scripts/281.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to extract the text between first comma and second comma in each line? (69%)
How to remove/delete the text from the '#' to the end in each line? (68%)
How to add a komma (,) after first and second words in each line? (66%)
How to extract text from 'start' to 'end' in each line? (66%)
How to sort the text by the number of specific word in each line? (64%)
How to limit a text file to less than 40 chars each line? (63%)
How to replace the first 3 spaces into comma in each line of text? (60%)
How to sort the text file by the date at the beginning of each line? (60%)

Check Demo of Advanced search and replace
Keywords:
second  delimiter  after  comma  input  how to delete  delete  delet  dele  fin  delete all text after comma  delete comma line  delete line comma  text search second comma  delete after  delete text after  replace all text after  after each line