User: editor -- 2010-05-19 << 513 515 >> |
Hits: 2594 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
How to enclose all the odd number of lines with a pair of tags? I have a file containing some data, I want to add a pair of <name> </name> at the begin and end of every odd line, and leave the even line untouched, how can I achieve it? |
Input Sample: |
Tommy 23 Jenny 56 Mark 18 ... |
Output Sample: |
<name>Tommy</name> 23 <name>Jenny</name> 56 <name>Mark</name> 18 ... |
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 dialog * set "Replace Unit" to "Line" * set "Unit Number filter" to: Note: 1<2> means only handle line of 1,3,5,7,...(start=1, step=2, end=infinite) * set "Replace with pattern" to: 3. click "Replace", done! |
Download Script: scripts/514.rst.zip |
Similar Examples: |
How to expand all the numbers in the list and seperate them by comma? (58%) How to batch rename files by appending the number of lines at the end? (57%) How to randomly deletes x number of lines from text files? (56%) How to randomly select one line from each paragraph? (56%) How to sort all the numbers in each line randomly? (56%) How to reverse all the words in each line of a csv file? (56%) How to add or subtract a value to a number in a line with a particular word? (55%) How to replace all duplicate lines with some text? (55%) |
Check Demo of Advanced search and replace |
Keywords: |
odd odd line even line leave even tags enclose tag number of lines unit number filter odd even even odd lines tags add text to every line end enclose all lines search and replace odd lines odd lines replace odd |