Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I really appreciate your help with a windows script or regex function that ports specific data from doc1 (xml in notepad++) to specific place(s) in doc2 (notepad++). I'm running win8. Thank you in advance!

Here is an example of what I'm trying to do...

So I'd like to have the 1st boldfaced name "peter.psx" string (on line 1) in Doc2 to go into where the name1 are in the 1st expression... Then the 2nd boldfaced name "bob.psx" string in Doc2 into where the name2 is in the 2nd expression of Doc1

Note: the 1st name1 is without .psx, where as in the body of the regex the name goes as peter.psx. The chanllenge is each name has different length...so some sort of script that parses doc2 and picks each name and paste it into doc1 as below...is what's needed.

Thank You!

===========================================================================

Doc1 -- has 4460 lines

<map>
<title>**name1**</title>
<link>aaaaaaaaaaaaaaa</link>
<regex>
<name>stock</name>
<exp>index':\z'(fin:[^']*)</exp>
<page>hxxp://Xfinancials.com/**name1.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<regex>
<name>file</name>
<exp>file':\zs'([^']*)</exp>
<page>hxxp://Xfinancials.com/**name1.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<regex>
<name>slip</name>
<exp>xcel.ps\?([^&]*)</exp>
<page>hxxp://Xfinancials.com/**name1.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<loan></loan>
</map>

<map>
<title>**name2**</title>
<link>aaaaaaaaaaaaaaa</link>
<regex>
<name>stock</name>
<exp>index':\z'(fin:[^']*)</exp>
<page>hxxp://Xfinancials.com/**name2.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<regex>
<name>file</name>
<exp>file':\zs'([^"]*)</exp>
<page>hxxp://Xfinancials.com/**name2.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<regex>
<name>slip</name>
<exp>xcel.ps\?([^&]*)</exp>
<page>hxxp://Xfinancials.com/**name2.psx**</page>
<ref>hxxp://Yfinancials.com/</ref>
</regex>
<loan></loan>
</map>

....

===========================================================================

Doc2 -- has 195 lines

src='**peter.psx**';"((span class="nume" mymonthly expenses month1))

src='**bob.psx**';"((span class="nume" mymonthly expenses month1))

src='**alexander.psx**';"((span class="nume" billing))

src='**james.psx**';"((span class="nume" James owes peter $20 dollars. He must pay ))

....

share|improve this question
    
Any takers guys? THX –  My PM Sep 23 '13 at 23:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.