Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1140.Advanced search and replace -- How to change each line of data to the specified format?

User: shanfeng -- 2013-09-29          << 1139  1141 >>
Hits: 3689
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to make a fixed length of each data byte occupies,and let figure in the designated area to the right side snapping,if the number of digits smaller than the specified field width, then fill a space left,but fill the zero right to decimal? 
Input Sample:
3.601080 260.000000 9999 9999 294.816650 79 984.087830 9999 
9999.000000 9999.000000 9999 9999 9999.000000 9999 9999.000000 9999 
3.086640 200.000000 100 10 293.705536 90 1018.967773 9999 
5.658840 230.000000 80 9999 296.483337 78 9999.000000 9999 
.000000 .000000 250 5 293.705536 90 1006.438110 9999 
2.057760 170.000000 999 2 293.149994 90 9999.000000 9999
Output Sample:
"_" means space here: 
____3.601080__260.000000_9999_9999__294.816650___79__984.087830_9999 
_9999.000000_9999.000000_9999_9999_9999.000000_9999_9999.000000_9999 
____3.086640__200.000000__100___10__293.705536___90_1018.967773_9999 
____5.658840__230.000000___80_9999__296.483337___78_9999.000000_9999 
_____.000000_____.000000__250____5__293.705536___90_1006.438110_9999 
____2.057760__170.000000__999____2__293.149994___90_9999.000000_9999
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to change each line into specified format? (89%)
How to decorate each of marching number with specified format? (69%)
How to change columns in each line to specified order in text file? (68%)
How to shuffle all lines of text in specified range? (67%)
How to convert a text file to specified format? (67%)
How to change the number in each line to specified order in a text file? (67%)
How to convert each line of a text file to the new format? (67%)
How to change text file format with user specified rules? (67%)

Check Demo of Advanced search and replace
Keywords:
how to make a fixed length of each data byte occupies  fixed length of each data byte occupies  fixed length  how to change each line of data to the specified format  smaller  zero  figure  sig  digits  fixed len  zero fill  fixed number  decimal number  length of a line  number length  length line  line length  search byte and replace