<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Replace guid with guid from list randomly]]></title><description><![CDATA[<p dir="auto">Good day.</p>
<p dir="auto">would anyone know how to replace a guid with another guid from a list and do this randomly.</p>
<p dir="auto">example : “d0ba703e-69d4-4253-9a8c-58668bce4aea” there are multiple of this guid in the file and i would like to replace it with the following in a random pattern:</p>
<p dir="auto">a3ba621f-884c-4954-87e3-063014e927ff<br />
b56483a2-3962-4d40-adc6-3f98cb4425c4<br />
3b00ca11-db38-4d1d-b1e1-7ad008399919<br />
540e5c95-4d79-4e70-8820-574b931c4a87<br />
6b3fea3f-f5a4-402e-a65a-cc022d733ed4<br />
e757d703-7e0f-49a5-8e11-0b79f2f1f39b<br />
703d5a2f-3793-4e76-a7bf-d5b73231dfff</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25388/replace-guid-with-guid-from-list-randomly</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 10:45:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25388.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 Jan 2024 06:15:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace guid with guid from list randomly on Sun, 21 Jan 2024 18:57:13 GMT]]></title><description><![CDATA[<p dir="auto">The regex gurus on this forum might come up with some kind of crazy regex-based solution to this, but this is pretty easy to solve with <a href="https://github.com/bruderstein/PythonScript" rel="nofollow ugc">PythonScript</a>.</p>
<pre><code># requires PythonScript: https://github.com/bruderstein/PythonScript/releases
# ref: https://community.notepad-plus-plus.org/topic/25388/replace-guid-with-guid-from-list-randomly

import random
import re
from Npp import editor, notepad, MESSAGEBOXFLAGS

def main():
    thing_to_replace = notepad.prompt('Enter the text you want to replace',
        'enter text to replace', '')
    if not thing_to_replace:
        return
    is_regex = notepad.messageBox(
        'Is the thing you want to replace a regular expression?',
        'regular expression?',
        MESSAGEBOXFLAGS.YESNO) == MESSAGEBOXFLAGS.RESULTYES
    if not is_regex:
        thing_to_replace = '(?-s)' + re.escape(thing_to_replace)
    replacements = notepad.prompt(
        'Enter a list of replacements (one per line)',
        'list of replacements', '')
    if not replacements:
        return
    replacement_list = replacements.strip().splitlines()
    def get_random_from_list(_):
        return random.choice(replacement_list)
    editor.rereplace(thing_to_replace, get_random_from_list)
    
if __name__ == '__main__':
    main()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/92242</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92242</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Sun, 21 Jan 2024 18:57:13 GMT</pubDate></item></channel></rss>