<?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[Add double quotes @ start and en of line + text in midle +more]]></title><description><![CDATA[<p dir="auto">After many hours searching I now have a basic understanding (limited to autohotkey experience).<br />
Seeking help to put the pieces together.<br />
1- need to add double quotes to the start and end of each lines<br />
2- I need to make this a single line with additional text after the first line (or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] =)</p>
<p dir="auto">The following list :<br />
Request 1.xls<br />
request 2.xls<br />
request 3.xls</p>
<p dir="auto">would become<br />
“Request 1.xls” or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] = “request 2.xls” or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] = “request 3.xls”</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20013/add-double-quotes-start-and-en-of-line-text-in-midle-more</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 19:05:37 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20013.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Sep 2020 14:23:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add double quotes @ start and en of line + text in midle +more on Sat, 06 May 2023 15:42:50 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://www.holyquranclasses.com/" rel="nofollow ugc">@Gilles-Girard</a> said in <a href="/post/57699">Add double quotes @ start and en of line + text in midle +more</a>:</p>
<blockquote>
<p dir="auto">After many hours searching I now have a basic understanding (limited to autohotkey experience).<br />
Seeking help to put the pieces together.<br />
1- need to add double quotes to the start and end of each lines<br />
2- I need to make this a single line with additional text after the first line (or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] =)<br />
The following list :<br />
Request 1.xls<br />
request 2.xls<br />
request 3.xls<br />
would become<br />
“Request 1.xls” or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] = “request 2.xls” or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] = “request 3.xls”</p>
</blockquote>
<p dir="auto"><img src="/assets/uploads/files/1683387484338-screenshot-2023-05-06-203733.png" alt="Screenshot 2023-05-06 203733.png" class=" img-fluid img-markdown" /><br />
This script first initializes a variable fileList with the names of the files. It then loops through the list and adds double quotes to the start and end of each file name using the Chr() function to insert the ASCII code for a double quote (34).</p>
<p dir="auto">The script also creates a variable output to store the final output string. The first file name is added to the output variable without the “or [<a href="http://Source.Name" rel="nofollow ugc">Source.Name</a>] =” prefix, while the rest of the file names are appended to output with the prefix.</p>
<p dir="auto">Finally, the MsgBox command displays the final output string as a message box.</p>
<p dir="auto">You can customize the fileList variable to include your own list of files. Just replace the names in the square brackets with your own file names.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/86196</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/86196</guid><dc:creator><![CDATA[Lufi Sa]]></dc:creator><pubDate>Sat, 06 May 2023 15:42:50 GMT</pubDate></item><item><title><![CDATA[Reply to Add double quotes @ start and en of line + text in midle +more on Fri, 18 Sep 2020 17:25:39 GMT]]></title><description><![CDATA[<p dir="auto">Thank you both for the great answers.<br />
@ astrosofista thanks for the suggestion, I forgot to mentioned my goal was to use native language of NPP.</p>
<p dir="auto">@ PeterJones, Thanks for the pointers the “(?-s)$” , “\x20” , “\R+(?!\Z)” , etc. would have been days of trial and error.</p>
<p dir="auto">I recorded the 2 macro and merged them manually in shortcuts.xml.</p>
<p dir="auto">Works like a charm.</p>
<pre><code>        &lt;/Macro&gt;
            &lt;Macro name="add quotes and source name and merge as single line" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^.+$" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam='&amp;quot;$0&amp;quot;' /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="512" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="\R+(?!\Z)" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="\x20or [Source.Name] =\x20" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="512" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
        &lt;/Macro&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/57706</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57706</guid><dc:creator><![CDATA[Gilles Girard]]></dc:creator><pubDate>Fri, 18 Sep 2020 17:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Add double quotes @ start and en of line + text in midle +more on Fri, 18 Sep 2020 15:20:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/gilles-girard" aria-label="Profile: Gilles-Girard">@<bdi>Gilles-Girard</bdi></a></p>
<p dir="auto">If you are not still convinced by <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>’ excellent advice, you can always construct the required line by means of an AutoHotkey script, as follows:</p>
<pre><code class="language-z">SampleText =
(
Request 1.xls
request 2.xls
request 3.xls
)

myText := " or [Source.Name] = "
myOutput := ""

for _, Lines in StrSplit(SampleText, "`n") {
	if (A_Index &lt; 3)
		myOutput .= """" Lines """" myText
	else
		myOutput .= """" Lines """"
}

MsgBox, % myOutput
; "Request 1.xls" or [Source.Name] = "request 2.xls" or [Source.Name] = "request 3.xls"
</code></pre>
<p dir="auto">Maybe there are simpler or better approaches in AutoHotkey, but I think that the regex solution is straightforward.</p>
<p dir="auto">Have fun!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57703</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57703</guid><dc:creator><![CDATA[astrosofista]]></dc:creator><pubDate>Fri, 18 Sep 2020 15:20:40 GMT</pubDate></item><item><title><![CDATA[Reply to Add double quotes @ start and en of line + text in midle +more on Fri, 18 Sep 2020 14:52:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gilles-girard" aria-label="Profile: Gilles-Girard">@<bdi>Gilles-Girard</bdi></a></p>
<p dir="auto">Not sure what autohotkey experience has to do with a Notepad++ search-and-replace.</p>
<p dir="auto">Use regular expressions [*].  For more info, see the Notepad++ Search and Replace docs, specifically for regular expressions: <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">https://npp-user-manual.org/docs/searching/#regular-expressions</a></p>
<p dir="auto">For a one-off, I would do a multi-step process.  It could be combined, but it’s easier to explain this way.</p>
<ol>
<li>add quotes around every non-empty line:
<ul>
<li>FIND = <code>(?-s)^.+$</code>
<ul>
<li>find each non-empty line</li>
</ul>
</li>
<li>REPLACE = <code>"$0"</code>
<ul>
<li>replace it with the same string (<code>$0</code> is the “text that was matched” placeholder), but with quotes around it</li>
</ul>
</li>
<li>SEARCH MODE = regular expression</li>
</ul>
</li>
<li>replace newlines with <code>[Source.Name] = </code>
<ul>
<li>FIND = <code>\R+(?!\Z)</code>
<ul>
<li><code>\R</code> means newline; the <code>+</code> means one or more; the stuff in parentheses means “that isn’t followed by the end of the file”, so this won’t replace the final newline in your file.</li>
</ul>
</li>
<li>REPLACE = <code>\x20or [Source.Name] =\x20</code>
<ul>
<li>the <code>\x20</code> are an alternate way of writing the space character; it works in regex, and it makes sure you don’t miss the leading or trailing space when copy/pasting from the forum</li>
</ul>
</li>
<li>MODE = regular expression</li>
</ul>
</li>
</ol>
<p dir="auto">If this isn’t sufficient for you, read and follow the advice below</p>
<p dir="auto">-—</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as plain text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get… Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/57700</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57700</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 18 Sep 2020 14:52:43 GMT</pubDate></item></channel></rss>