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: 375
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 the first 10 and last 10 characters from each line? (63%)
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%)
How to sort many lines by comparing the second word in each line? (61%)
How to extract text from 'start' to 'end' in each line? (60%)
How to split a text file according to first word in each line? (58%)

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