Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

393.Regular expression replace -- How to change text file format with user specified rules?

User: wenbo -- 2010-01-15          << 392  394 >>
Hits: 494
Type: Regular expression replace   
Search all Regular expression replace examples
Description:
How I can exchange the special pattern characters to the most following another special pattern ?
Input Sample:
"A/G"
CGGCAGAGAA CAGGTYASCC ACCACTATGC
R
CAGGTTCTCA TCATTGAAGC TGCTCTCAGG
"C/G"
TATGGGCCCG CGTGGCGCGA GCAGAGGCGC
TTCTCCGT
S
TCCACCTTGC GCAACTTGGG CCTGGGCAAG
AAGTCGCTGG

Output Sample:
CGGCAGAGAA CAGGTYASCC ACCACTATGC
[A/G]
CAGGTTCTCA TCATTGAAGC TGCTCTCAGG
TATGGGCCCG CGTGGCGCGA GCAGAGGCGC
TTCTCCGT
[C/G]
TCCACCTTGC GCAACTTGGG CCTGGGCAAG
AAGTCGCTGG
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume you want to change following format:

"X/Y"
************************
****************
*

with following format:
************************
****************
[X/Y]

Procedures:
1. ctrl-o open source text file
2. ctrl-h open 'replace' dialog
* in "search for pattern", enter:

* in "replace with pattern", enter:

3. Click 'Replace', done
4. Ctrl-s save to file
Download Script:  scripts/393.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to convert the text format by user specified rules? (86%)
How to convert a text file to specified format? (67%)
How to parse data from the text file and create text with  user specified format? (67%)
How to split a large text file into specified various number of lines? (62%)
How to change text file with hexidecimal format into original binary file? (62%)
How to search and replace text 'ReplaceMe' only in specified lines? (61%)
How to convert the text from hex format to ascii format? (60%)
How to change all numbers in a text file to 2 decimial places? (60%)

Check Demo of Regular expression replace
Keywords:
exchange  special  rules  user  sum  regular expression  characters  expression  file format  format  special characters  exchange replace  replace another  specified format  another file  text replace rules  replace characters  replace pattern in text file