User: Dilip -- 2014-12-12 << 1272 1274 >> |
Hits: 3028 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
How to group all elements in a specified range in text file? I want to group list items based on text/characters present in between <li> tags found within <ul> tag Here I want to group based on length if cm or mm is found within that <li> tag and push it to the last before closure of </ul> tag |
Input Sample: |
<ul> <li>Pallet contents</li> <li>Length : 100cm</li> <li>Superb Product</li> <li>200 mm width</li> <li>Handle with Care</li> <li>The height is 20 cm; breadth; 10 cm</li> <li>Discount Sale</li> </ul> |
Output Sample: |
<ul> <li>Pallet contents</li> <li>Superb Product</li> <li>Handle with Care</li> <li>Discount Sale</li> <li>Length : 100cm</li> <li>200 mm width</li> <li>The height is 20 cm; breadth; 10 cm</li> </ul> |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
The following steps will move all <li> items with cm/mm to the end of "ul" tag: 1. ctrl-o open text file 2. ctrl-h open 'replace' dialogue * set 'search for pattern' to: * set 'replace with pattern' to: 3. click 'replace', done. |
Screenshot 1: Replace_Window |
Similar Examples: |
How to shuffle all elements in a specified range in text file? (73%) How to shuffle all lines of text in specified range? (69%) How to replace all specified symbols with dot in specified range? (65%) How to re-group all lines in a file by a wordlist file? (61%) How to rip out all but line 1 and specified text? (61%) How to refine multiple text files by specified rules? (60%) How to extract all lines with specified date range from text file? (60%) How to sort all lines of text by specified keyword? (60%) |
Check Demo of Advanced search and replace |
Keywords: |
within based on range grep length tags found group tag before replace text in specified range li before last search replace between tags text between tags replace between characters replace in specified range join between and replace text in range |