Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

95.Advanced search and replace -- How to replace the characters in fixed position in each line?

User: editor -- 2008-05-13          << 94  96 >>
Hits: 2036
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace the characters in fixed position in each line? I want to multiply character 6,7 by 2 in each line.
Input Sample:
1234501abcde
1234502abcde
1234503abcde
...
Output Sample:
1234502abcde
1234504abcde
1234506abcde
...
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' page,     
1)set 'replace unit' to 'Line'
2)set 'Search for Pattern':
 means for every line
3)set 'Replace with Pattern':

3. Click 'Replace', that's ok!  

Notes:
chars($match,1,5) means characters 1 to 5
calc(chars($match,6,7)*2,"02") means characters 6,7 multiplied by 2, lengh=2
chars($match,8,-1) means characters 8 to last
Download Script:  scripts/95.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to replace a character based on its position in line? (83%)
How to batch replace files with specified format in each line? (66%)
How to delete the same field in each line? (64%)
How to replace bytes in the specific postion of many binary files? (64%)
How to add a space at the specific location of each line? (62%)
How to add a space after the 15 character of each line? (62%)
How to remove all hyphens after the first tab in each line? (61%)
How to add a space in the middle of the two characters in each line? (61%)

Check Demo of Advanced search and replace
Keywords:
multiply  position  fixed  fix  every line  last  every  characters  very  las  search in each line by position  multiply line  multiply file  replace position  every character  last character  1 character in each line  last line