Hello, @ganesan-govindarajan, @terry-r and All,
How are you ? Fine, I hope so ! Although I may have completely misunderstood your goal, I found out a very simple solution :
Just follow carefully this road map :
Open your XML file, containing your list of tasks, in Notepad++
Delete any possible trailing list of references, located at the very end of your file
=> So, we start with that INPUT text :
<task breaknbr="00" chapnbr="71" chg="U" func="100" key="TASK-712101100800" pgblknbr="601" revdate="20190915" sectnbr="21" seq="800" subjnbr="01"> <effect effrg="TAY/ALL" efftext="TAY/ALL"></effect> <title>title</title> <subtask chapnbr="71" chg="U" func="860" key="SUBTASK-712101860003" pgblknbr="601" revdate="20190915" sectnbr="21" seq="003" subjnbr="01"> <title>Data</title> <list1> <l1item> <para>para</para> </l1item> <l1item> <para>para</para> <unlist> <unlitem> <para>para</para> <para>para</para> </unlitem> </unlist> </l1item> <l1item> <para>para</para> <unlist> <unlitem> <para>TASK 71-21-01-100-80 para continues.</para> </unlitem> </unlist> </l1item> </list1> </subtask> </task> <task breaknbr="00" chapnbr="71" chg="U" func="100" key="TASK-712101100801" pgblknbr="601" revdate="20190915" sectnbr="21" seq="800" subjnbr="01"> <effect effrg="TAY/ALL" efftext="TAY/ALL"></effect> <title>title</title> <subtask chapnbr="71" chg="U" func="860" key="SUBTASK-712101860003" pgblknbr="601" revdate="20190915" sectnbr="21" seq="003" subjnbr="01"> <title>Data</title> <list1> <l1item> <para>para</para> </l1item> <l1item> <para>para</para> <unlist> <unlitem> <para>para</para> <para>para</para> </unlitem> </unlist> </l1item> <l1item> <para>para</para> <unlist> <unlitem> <para>TASK 71-21-01-200-801 para continues.</para> </unlitem> </unlist> </l1item> </list1> </subtask> </task>Move to the very beginning of your XML file
Open the Mark dialog ( Ctrl + M )
Type in (?-s)(?<=key=")TASK-.+?(?=")|(?<=<para>)TASK\x20[\d-]+ in the Find what : field
Untick all box options
Check the Purge for each search and Match case options
Select the Regular expression search mode
Click on the Mark All button
=> You’ll get the message : Mark: 4 matches from caret to end-of-file
Click on the Copy Marked Text button
Go to the very end of your file ( Ctrl + End )
Enter few line-breaks, hitting the Enter key
Then, paste the clipboard contents ( Ctrl + V )
=> From the INPUT text, you should get this temporary output below, after your XML contents :
TASK-712101100800 TASK 71-21-01-100-80 TASK-712101100801 TASK 71-21-01-200-801Now, move the caret at the beginning of this new pasted text
Open the REPLACE dialog ( Ctrl + H )
Untick all box options
Type in (?-s)^(.+)\R(.+) in the Find what : field
Type in \2\t\1 in the Replace with : field
Click on the Replace All button
=> Here you are ! You’ll get the final expected OUTPUT, below, under your XML contents :
TASK 71-21-01-100-80 TASK-712101100800 TASK 71-21-01-200-801 TASK-712101100801Best Regards,
guy038