Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

439.Text file parser -- How to extract all telephone numbers from a text file?

User: editor -- 2010-03-06
Hits: 137
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract all telephone numbers from a text file?

The typical telephone number is a string that with more than 8 chars of 0-9, +, -, (, )
Input Sample:
test number1 +12-3456789-342
test number2 12345
test number3 (23)3266051
test 58802222
Output Sample:
+12-3456789-342
(23)3266051
58802222
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' window
* in 'search for pattern', enter:

* in 'replace with pattern', enter:

* uncheck 'Print Unmatched unit' option
3. click 'Replace', all telephone numbers are extracted
4. ctrl-s save to file
Download Script:  scripts/439.rst.zip

Similar Examples:
How to extract all lines longer than 80 characters from a text file? (73%)
How to extract all IP address from a text file? (72%)
How to extract all email addresses from many text files? (70%)
How to extract/parse all upper cases Acronyms from a text file? (68%)
How to extract all image links from a html file? (68%)
How to replace all the numbers in a text file to the square value? (66%)
How to reverse all cases of letters in a text file? (66%)
How to reset all the numbers with format id=NNN in a text file?  (65%)

Check Demo of Text file parser