Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

628.Text file parser -- How to extract the text between first comma and second comma in each line?

User: editor -- 2010-10-12          << 627  629 >>
Hits: 3619
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract the text between first comma and second comma in each line?
Input Sample:
f1,f2,f3,f4 
f21,f22,f23,f24 
f31,f32,f33 
f41,f42 
...
Output Sample:
f2 
f22 
f32 
f42 
...
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 'replace with pattern', enter: 
 
3. click 'Replace', done! 
 
Note: above operation means replace each line with the 2nd word in the line, the word delimiter is comma ","

Screenshot 1:  Replace_Window


Similar Examples:
How to delete all text after the second comma in each line? (71%)
How to extract text between specified start and end strings? (65%)
How to extract text after last comma in a string in htmlx file? (63%)
How to extract the first 10 and last 10 characters from each line? (63%)
How to insert a separator before the first Chinese char in each line? (61%)
How to sort the text by the number of specific word in each line? (61%)
How to replace the first 3 spaces into comma in each line of text? (61%)
How to add a komma (,) after first and second words in each line? (61%)

Check Demo of Text file parser
Keywords:
2nd  delimiter  second  comma  operation  between  text file parser  file parser  parser  parse  replace 2nd comma in each line  replace 2nd comma  extract 2nd line  replace comma second line  replace second comma in text file  extract text between  extract between  first and second word