Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
1415.Text sort -- How to sort xml values in descending order where is no line break?
User:
Dilip -- 2018-02-08
<< 1414
1416 >>
Hits:
3491
Type:
Text sort
Search all
Text sort
examples
Description:
Sort xml values in a line in descending order where is no line break!
Input Sample:
<item><stock>100</stock>
<stock>2000</stock></item>
Output Sample:
<item><stock>2000</stock>
<stock>100</stock></item>
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' dialog:
*set 'search for pattern' to:
(
\d+<\/stock>\s*)+
*set 'replace with pattern' to:
join("\n",sort{words($b,3,3,'[<>]')<=> words($a,3,3,'[<>]')}$match=~/(
.*?<\/stock>)/gs)
3. click 'replace', done.
4. ctrl-s save to file.
Screenshot 1: Replace_Window
Similar Examples:
How to convert multiple files from one encoding to another with online tool?
(57%)
How to sort specified items descendingly in each line?
(55%)
How to sort the numbers in each line by the descending order in a text file?
(55%)
How to sort the lines in a text files by the order of line length?
(54%)
How to sort all the numbers in each line randomly?
(53%)
How to sort each line of text by the order of reversed line?
(53%)
How to sort all words in alphabetic order for each line in CSV file?
(52%)
How to sort the text file by the date at the beginning of each line?
(52%)
Check Demo of
Text sort
Keywords:
descending
xml
line break
break
desc
stock
toc
sort word
order
values
xml join
replace text in xml
xml search replace
replace xml
xml file
sort words text file
line order
order line