<?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[How to locate text separators and replace them?]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I have a csv file coding in UTF-8 format that contain a lot of string separate from comma.<br />
Comma is also included in the text as normal charachter.</p>
<p dir="auto">I want to replace the comma that work like a separator with another like semicolon (“;”) and keep the comma within the text unchanged.<br />
It’s possible using the regular expression?</p>
<p dir="auto">e.g.<br />
The original string is:<br />
504780607315,"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!, oldtext, other</p>
<p dir="auto">As you can see the first the fifth and the sixth commas are a delimiter character, the second, the third and fourth instead are the commas within the text.</p>
<p dir="auto">what I want to get is:</p>
<p dir="auto">504780607315;"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!; oldtext; other</p>
<p dir="auto">so when a import the file in excel the result will be:</p>
<p dir="auto">Column A :504780607315<br />
Column B : "Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!<br />
Column C: oldtext<br />
Column D: other</p>
<p dir="auto">I hope someone can help me<br />
Thanks in advance<br />
Andrea</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18388/how-to-locate-text-separators-and-replace-them</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 09:12:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18388.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Oct 2019 11:34:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 19 Sep 2021 17:09:09 GMT]]></title><description><![CDATA[<p dir="auto">This seemed like it should be top of list, but here goes</p>
<p dir="auto">I need to replace comma “,” with a pipe “|”, but only if a comma immediately follow a 2 digit decimal.</p>
<p dir="auto">So<br />
,49.30,49.30,.00,.00,.00,<br />
needs to be<br />
|49.30|49.30|.00|.00|.00|</p>
<p dir="auto">notepad++ (Regular expression radio button clicked)<br />
in the “Find what:” box -&gt;  (?:[.\d\d]{0},)<br />
in the “Replace with:” box -&gt; |</p>
<p dir="auto">add “\d” for more decimals.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69837</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69837</guid><dc:creator><![CDATA[Patrick Chatelle]]></dc:creator><pubDate>Sun, 19 Sep 2021 17:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 02 Nov 2019 08:51:35 GMT]]></title><description><![CDATA[<p dir="auto">Thank you everyone for the replay.<br />
I have followed The guy038 suggestion and seems works.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48260</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48260</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Sat, 02 Nov 2019 08:51:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Wed, 23 Oct 2019 10:11:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: andrew-staibuz">@<bdi>andrew-staibuz</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I’ve found a <strong>small</strong> error, relative to an <strong>unique</strong> line, beginning with <strong><code>394318123243|"""Commander, the operation went as planned............</code></strong>, which contained, initially, <strong><code>4</code></strong> <strong>consecutive</strong> double-quotes (<strong><code>"</code></strong>)</p>
<p dir="auto">I <strong>previously</strong> proposed to change the <strong><code>""""</code></strong> string with <strong><code>""","</code></strong>. However, in order that this line has exactly <strong><code>18</code></strong> fields, the <strong>correct</strong> replacement should be <strong><code>""•</code></strong> !</p>
<p dir="auto">Of course, I also <strong>updated</strong> my <strong>previous</strong> post and some <strong>replacement</strong> numbers ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48011</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48011</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 23 Oct 2019 10:11:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 14 Mar 2021 16:50:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: andrew-staibuz">@<bdi>andrew-staibuz</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Perfect, Andrew ! I managed to <strong>modify</strong> your file and get <strong>normal</strong> records, <strong>delimited</strong> in <strong><code>18</code></strong> columns, with <strong><code>17</code></strong> <strong>pipe</strong> chars ( <strong><code>|</code></strong> ), while keeping the <strong>commas</strong> in the areas between <strong>double quotation</strong> marks</p>
<p dir="auto">As I explained in my short <strong>previous</strong> post, I first will <strong>delete</strong> some exedentary <strong>EOL</strong> chars in order to get <strong>complete</strong> lines.</p>
<p dir="auto">Note that all <strong>S/R</strong> are done with :</p>
<ul>
<li>
<p dir="auto">The option <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">The option <strong><code>Wrap Around</code></strong></p>
</li>
<li>
<p dir="auto">A click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<p dir="auto">Here are the different steps :</p>
<ul>
<li>
<p dir="auto">First, any <strong>blank</strong> lines or lines with a <strong>single space</strong> char are replaced with a <strong>single space</strong> char</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>\R\x20?\R</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>2,840</code></strong> replacements</p>
<ul>
<li>
<p dir="auto">Now, if any line contains <strong>less</strong> than <strong><code>17</code></strong> commas, we changed its <strong>EOL</strong> char with a <strong>single space</strong> char</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>^\d+,([^,\r\n]*,){0,15}[^,\r\n]+\K\R</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>243</code></strong> replacements</p>
<ul>
<li>
<p dir="auto">Then, if any <strong>EOL</strong> char is <strong>NOT</strong> followed with a number of <strong>digits</strong> and a <strong>comma</strong> ( Beginning of a <strong>standard</strong> line ) <strong>NOR</strong> with the <strong>very end</strong> of file, we changed this <strong>EOL</strong>, again, with a <strong>single space</strong> char</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>\R(?!\d+,|\Z)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>292</code></strong> replacements</p>
<hr />
<p dir="auto">At this point, we could think that your file is quite <strong>neat</strong> ! Yet, <strong>few weird</strong> things remain, concerning <strong>consecutive</strong> double-quotes ( <strong><code>"</code></strong> ) sequences :-(( So, to <strong>simplify</strong> the problem, I thought that it was better to replace, in some particular cases, <strong>two consecutive</strong> <strong><code>"</code></strong> chars with a <strong>temporary</strong> dummy character. I chose the <strong>bullet</strong> character <strong><code>•</code></strong>  ( Unicode <strong>\x{2022}</strong> )</p>
<p dir="auto">For instance :</p>
<ul>
<li>The search of <strong><code>""""</code></strong> ( <strong>four</strong> consecutive <strong>double-quotes</strong> ) find <strong><code>1</code></strong> record, below :</li>
</ul>
<pre><code class="language-diff">394318123243,"""Commander, the operation went as planned. We produced vast quantities of the Water of Peace and placed them in them water extractors. When they workd, this water of Piece entered them undergraund deposits. It didnt work purfect as mars wata supply is veri lou but it stil afekted a lots of peoples. We fil gud as we never biin frends liek dis befor. All is wel comander no wore!!!!!"""" It seems this Water of Peace reacted chemically with another element in the Martian waters and now not only affects the natural aggressiveness of human beings, but it also drastically reduces their overall intelligence.  &lt;effect&gt;&lt;count_idiots&gt; Colonists gain the Idiot and the Enthusiast traits. Mars has gained &lt;resource(terr_water,'WaterTP')&gt;. The genius loses Sanity.",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/StoryBit/MartianPeace_FollowUp4.lua(00032),StoryBit MartianPeace_FollowUp4 Text,,,,243013,0,758 )
</code></pre>
<p dir="auto">After examination, I thought that the sensible replacement was <strong><code>""•</code></strong> ( <strong><code>1</code></strong> <strong>manual</strong> replacement )</p>
<ul>
<li>
<p dir="auto">Some lines contain text like <strong><code>...,123,"abc def ""ghi jkl""",456,...</code></strong>. Like above, for these configurations , it’s sensible to replace the <strong>inner</strong> <strong><code>2</code></strong> double-quotes of the expression with the **bullet <strong><code>•</code></strong> char, leading to the <strong>more simple</strong> syntax <strong><code>...,123,"abc def •ghi jkl•",456,...</code></strong> !</p>
</li>
<li>
<p dir="auto">So :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>""([^"\r\n]+)""</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>•\1•</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>339</code></strong> replacements</p>
<ul>
<li>Now, the search of <strong><code>"""</code></strong> ( <strong>three</strong> consecutive <strong>double-quotes</strong> ) find <strong><code>1</code></strong> record, below :</li>
</ul>
<pre><code class="language-diff">453668807094,"""Er... say what now?",,,,new,,,,,Trunk\Mars/Data/StoryBit/BadBoyGenius_Success.lua(00019),,,narrator,narrator,238196,,20
</code></pre>
<p dir="auto">After examination, I thought that the sensible replacement was <strong><code>"•</code></strong> ( <strong><code>1</code></strong> <strong>manual</strong> replacement )</p>
<ul>
<li>At last, the search of <strong><code>""</code></strong> ( <strong>two</strong> consecutive <strong>double-quotes</strong> ) find <strong><code>4</code></strong> records, in <strong><code>2</code></strong> lines, below :</li>
</ul>
<pre><code class="language-diff">6265,"EsoCorp is having obvious issues with their mysterious rovers as they seem to be malfunctioning one after the other. Instead of admitting the faults in their predictions about the rough Martian conditions, the EsoCorp team has sent us a message which, quote, ""gives the Martian Colony Command the rare privilege of sending one of our more analytical vehicles to look into the most certainly small miscalculation that causes these temporary annoyances.” End quote. Furthermore - they go on to remind us that, by choosing to analyze their broken vehicles, we have an understanding not to dig beyond any obvious logistical shortcomings in their design and agree to full and utter discretion. &lt;effect&gt;An Anomaly has appeared next to a malfunctioned vehicle.",,"EsoCorp is having obvious issues with their mysterious rovers as they seem to be malfunctioning one after the other. Instead of admitting the faults in their predictions about the rough Martian conditions, the EsoCorp team has sent us a message which, quote, ""gives the Martian Colony Command the rare privilege of sending one of our more analytical vehicles to look into the most certainly small miscalculation that causes these temporary annoyances.” End quote. Furthermore - they go on to remind us that, by choosing to analyze their broken vehicles, we have an understanding not to dig beyond any obvious logistical shortcomings in their design and agree to full and utter discretion. &lt;effect&gt;An Anomaly has appeared next to a malfunctioning vehicle.","EsoCorp is having obvious issues with their mysterious rovers as they seem to be malfunctioning one after the other. Instead of admitting the faults in their predictions about the rough Martian conditions, the EsoCorp team has sent us a message which, quote, ""gives the Martian Colony Command the rare privilege of sending one of our more analytical vehicles to look into the most certainly small miscalculation that causes these temporary annoyances.” End quote. Furthermore - they go on to remind us that, by choosing to analyze their broken vehicles, we have an understanding not to dig beyond any obvious logistical shortcomings in their design and agree to full and utter discretion. &lt;effect&gt;An Anomaly has appeared next to a malfunctioned vehicle.",changed,,,,,Trunk\Mars/Data/Scenario/Mystery_6.lua(00173),Scenario Mystery 6 text,,,,223739,,3

935811765411,"Damn... I... I did not think of this. Actually, I did, I just thought that... I give up. I'll behave."" &lt;effect&gt;Stolen funding was refunded.",,,,new,,,,,Trunk\Mars/Data/StoryBit/BadBoyGenius_Success.lua(00016),StoryBit BadBoyGenius_Success Text,,,,238196,,140
</code></pre>
<p dir="auto">After examination, again, I thought that the sensible replacement was <strong><code>•</code></strong> ( <strong><code>4</code></strong> <strong>manual</strong> replacements )</p>
<p dir="auto">Of course, <strong>Andrew</strong>, it would be better to have a look to these <strong><code>6</code></strong> lines <strong>manually</strong> changed, in order to verify if <strong>my</strong> choices were <strong>correct</strong> or no ;-))</p>
<p dir="auto">As a <strong>verification</strong>, the search of <strong><code>"{2,}</code></strong> ( any list of <strong>consecutive</strong> double-quotes ) does give <strong><code>0</code></strong> occurrence ;-)). Now, you’re sure that exiting double-quotes <strong>begins</strong> or <strong>ends</strong> a field and that exists, at least, <strong>one</strong> char between these <strong>double-quotes</strong> ;-))</p>
<p dir="auto">Your file, with <strong>correct</strong> syntax, has <strong><code>16,323</code></strong> lines + <strong><code>1</code></strong> <strong>header</strong> line</p>
<hr />
<p dir="auto">Now, we turn to the main <strong>S/R</strong> replacements :</p>
<ul>
<li>
<p dir="auto">First, we’ll replace any <strong>comma</strong>, in zones between <strong>double-quotes</strong>, with a <strong>dummy</strong> char, <strong>non-existent</strong> in your file. I choosed the <strong><code>@</code></strong> character</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(,"[^"\r\n]*),([^,"\r\n]*")</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\1@\2</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto"><strong>IMPORTANT</strong> You’have to click <strong>several</strong> times, on the <strong><code>Replace All</code></strong> button, till the message <strong><code>Replace All: 0 occurences were replaced.</code></strong> is displayed. So :</p>
<p dir="auto">= <strong><code>3,483</code></strong> + <strong><code>1,446</code></strong> + <strong><code>705</code></strong> + <strong><code>390</code></strong> + <strong><code>232</code></strong> + <strong><code>137</code></strong> + <strong><code>89</code></strong> + <strong><code>54</code></strong> + <strong><code>39</code></strong> + <strong><code>27</code></strong> + <strong><code>19</code></strong> +  <strong><code>17</code></strong> + <strong><code>8</code></strong> + <strong><code>4</code></strong> + <strong><code>3</code></strong> + <strong><code>3</code></strong> + <strong><code>0</code></strong>  = <strong><code>6,656</code></strong> replacements, after <strong><code>17</code></strong> clicks on the <strong><code>Replace All</code></strong> button</p>
<ul>
<li>
<p dir="auto">Then, we change any <strong>comma</strong> delimiter with an other <strong>dummy</strong> character ( I chosed the <strong>Pipe</strong> symbol <strong><code>|</code></strong> ) :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>,</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>|</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>277,508</code></strong> replacements</p>
<ul>
<li>
<p dir="auto">So, now, we can change our temporary <strong><code>@</code></strong> in order to get, again, <strong>commas</strong>, inside the <strong>double-quotes</strong> zones :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>@</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>,</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>6,656</code></strong> replacements</p>
<ul>
<li>
<p dir="auto">And finally, we change our temporary <strong><code>•</code></strong> <strong>bullet</strong> char, to get the original <strong>two</strong> double-quotes :</p>
</li>
<li>
<p dir="auto">SEARCH <strong><code>•</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>""</code></strong></p>
</li>
</ul>
<p dir="auto">=&gt; <strong><code>684</code></strong> replacements</p>
<p dir="auto">Et voilà !</p>
<p dir="auto">As a final <strong>check</strong>, let’s count the <strong>number</strong> of lines, containing <strong><code>18</code></strong> fields, separated with <strong><code>17</code></strong> <strong>new</strong> delimiters <strong><code>|</code></strong>,  in our <strong>modified</strong> file, with the regex :</p>
<p dir="auto">COUNT <strong><code>^([^|\r\n]*\|){17}[^|\r\n]*$</code></strong></p>
<p dir="auto">Luckily, we get the <strong>expected</strong> result : <strong><code>16,324</code></strong> occurrences, which is the <strong>exact</strong> number of lines ;-))</p>
<hr />
<p dir="auto">If you prefer, <strong>Andrew</strong>, here is my <strong>e-mail</strong> address, below. So, just e-mail me and I 'll send you back the <strong><code>NEW-English.csv</code></strong> file ;-))</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">If you’d like some <strong>additional</strong> information on the <strong>regexes</strong> used, just tell me. Just <strong>enough</strong> for today ;-))</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48006</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48006</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 14 Mar 2021 16:50:02 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Tue, 22 Oct 2019 17:09:47 GMT]]></title><description><![CDATA[<p dir="auto">I wonder if you could use a different sequence:</p>
<ol>
<li>open with excel</li>
<li>export to a new CSV, but with a different separator character (see <a href="https://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/" rel="nofollow ugc">this page</a> for instructions to change what separator character Excel will use for exporting CSV).  Don’t forget to change the separator character back when done, in case it messes up some other program</li>
<li>open the file in Notepad++ to do other edits, with commas now only existing in the real data, rather than as separators</li>
<li>make your edits</li>
<li>since your separator character was unique, you should just be able to change that character back to comma inside Notepad++</li>
<li>assuming you didn’t play around with the nesting of quotes, your file should still be valid CSV when you’re done</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/48001</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48001</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 22 Oct 2019 17:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Tue, 22 Oct 2019 16:59:01 GMT]]></title><description><![CDATA[<p dir="auto">I Hope you could find a solution soon.<br />
Meanwhile I have chosen to open the csv with Execel using the import data function and setting up the parametres.<br />
Then manually apply the correction needed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48000</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48000</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Tue, 22 Oct 2019 16:59:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Mon, 21 Oct 2019 22:38:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: andrew-staibuz">@<bdi>andrew-staibuz</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Aaaaaaah, <strong>Peter</strong>, how <strong>silly</strong> I am :-( I’ve just forgot that a <strong>standard</strong> line could be split on <strong>several</strong> lines !. So, after deleting some <strong>EOL</strong>, I ended up with a <strong>neat</strong> file of <strong><code>16,324</code></strong> lines, which contains <strong><code>13,696</code></strong> <strong>standard</strong> lines (with <strong><code>17</code></strong> <strong>comma</strong> delimiters )</p>
<p dir="auto">Of course, the final file does <strong>not</strong> contain lines, with <strong>less</strong> than <strong><code>17</code></strong> commas. However, it remains, as expected, <strong><code>2,627</code></strong> lines which contain <strong>possible commas</strong> in zones, delimited between <strong><code>2</code></strong> <strong>double-quotes</strong> !</p>
<p dir="auto">So, I’m still inverstigating for the way to <strong>just</strong> replace <strong>comma</strong> delimiters, <strong>outside</strong> these <strong>double-quotes</strong> delimited zones. But, <strong>Andrew</strong>, I am quite <strong>confident</strong> that I can come up with the <strong>solution</strong> very soon ;-))</p>
<p dir="auto">See you later,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47980</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47980</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 21 Oct 2019 22:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Mon, 21 Oct 2019 16:47:34 GMT]]></title><description><![CDATA[<p dir="auto">Thanks everyone for the suggestion!!!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47973</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47973</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Mon, 21 Oct 2019 16:47:34 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Mon, 21 Oct 2019 13:37:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: Andrew-Staibuz">@<bdi>Andrew-Staibuz</bdi></a> said in <a href="/post/47911">How to locate text separators and replace them?</a>:</p>
<blockquote>
<p dir="auto">so when a import the file in excel the result will be</p>
</blockquote>
<p dir="auto">Since you want to process the data with Excel anyway, why do you not <strong>import</strong> your original CSV file into Excel? When you choose the right method to do that, you will be guided through that process by an Excel wizzard, which can be told to use the comma as field separator. It also allows to choose UTF-8 as the character encoding of your source file.</p>
<p dir="auto">[EDIT]<br />
It is also possible to script this task, have a look at my <a href="https://github.com/dinkumoil/ScriptCollection/blob/master/CSV-Viewer/CSV-Viewer.vbs" rel="nofollow ugc">CSV Viewer script</a>. It lacks the part of saving a copy of the input file with different field delimiters but that’s no difficult job, Google gave me for example <a href="https://devblogs.microsoft.com/scripting/how-can-i-save-a-single-excel-worksheet-to-a-csv-file/" rel="nofollow ugc">this result</a>.<br />
[/EDIT]</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47953</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47953</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Mon, 21 Oct 2019 13:37:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Mon, 21 Oct 2019 00:00:05 GMT]]></title><description><![CDATA[<p dir="auto">And as far as <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> 's processing: I think the better first step would be to merge any line that doesn’t start with a 12-digit number with the line before it (using your magic never-used character… some unused punctuation/symbol, or perhaps some rare unicode character); once you do that, all lines should have the right number of commas…  Though trying to write a regex that can distinguish between the commas of valid separators and the commas embedded in strings (even after the multiline merge), would be quite difficult.  Though if anyone can, you could. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47951</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47951</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 21 Oct 2019 00:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 20 Oct 2019 23:56:10 GMT]]></title><description><![CDATA[<p dir="auto">Based on that file, it turns out the problem is <em>not</em> malformed CSV.  The problems is that there are multilined cells.  The google drive link you posted rendered it as a reasonable CSV, with the proper multiline cells.  For example, the first line that <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> used as an example, line 12851, which is actually part of ID=641279561181</p>
<pre><code>641279561181,"Your security advisor reports that Mr. Altmann somehow found out he was being watched. He managed to steal a space suit and disappear. Security officers found a package and a note in his apartment:

""Commander, I have my reasons to believe that you will grasp what I have to say. I am an ambassador from another civilization which conquered space long ago. My mission here is done and I assure you that I have the best possible impression of your people. I shall advocate for you in the Galactic Council. Now I know I have to disappear for the good of everyone. Don't look for me, for you will not find me. 
As a parting gift, I'm leaving this growth substance. Spread it throughout Mars and let it flourish.""

Your botanists confirm that the substance is some sort of a moss which can slowly replicate.

&lt;effect&gt;John Altmann disappeared. Mars has gained &lt;resource(terr_veg,'VegetationTP')&gt;.",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/StoryBit/TheManFromMars_FollowUp3.lua(00018),StoryBit TheManFromMars_FollowUp3 Text,,,,243013,0,891
</code></pre>
<p dir="auto">and the complete version of the example you mangled,</p>
<pre><code>504780607315,"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah... But was actually here, on Mars!

Our restless efforts to purify the Martian atmosphere and make it suitable for humans have never achieved a more significant milestone. We are halfway there! But there is a lot of work remaining to be done.",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/PopupNotificationPreset.lua(00087),PopupNotificationPreset AtmosphereCleared text,,,,240619,0,437
</code></pre>
<p dir="auto">My plan of attack for such a file would be …  to use a proper CSV parser, like Excel or one of the free spreadsheet programs (Google Spreadsheet, or Open Office Calc, or LibreOffice Calc, or pre-formed libraries for whatever programming language you are using, rather than rolling your own incorrect CSV-parser in that language…) not a regex.  Because a proper parser sees all those correctly, and you don’t have to translate any of the separators.</p>
<p dir="auto">I’m not sure what you’re really trying to do, because replacing the separator won’t really help you: it’s already correctly formed for a CSV spreadsheet (I just made sure OpenOffice Calc could read it just fine, and properly recognized the multi-line cells).  So I can only assume after “fixing” it with Notepad++, you are trying to run it through some other program you or a friend/coworker/online-hacker have written that doesn’t properly handle well-formed multiline cells in CSV text.  But by going down that route, you are just going to corrupt good data, not fix it.</p>
<p dir="auto">So, rather than the <a href="https://en.wikipedia.org/wiki/XY_problem" rel="nofollow ugc">XY-problem</a> of “give me a regex that will change the separators in this CSV”, tell us what you’re actually trying to <em>accomplish</em>, and we can give hints whether that would be better done in Notepad++ or in some other tool.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47950</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47950</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 20 Oct 2019 23:56:10 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Thu, 24 Nov 2022 12:03:18 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: andrew-staibuz">@<bdi>andrew-staibuz</bdi></a> and <strong>All</strong></p>
<p dir="auto">Seemingly, your table has <strong><code>22,538</code></strong> rows + the <strong>header</strong> row. This header contains the <strong><code>18</code></strong> columns, below</p>
<pre><code class="language-diff">ID
Text
Translation
Old Text
Old Translation
Status
Gender
Critical Warnings
Non-critical Warnings
Platform Warnings
Location
Context
Section
Actor
Voice Actor
Revision
Old Revision
Edit Distance
</code></pre>
<p dir="auto">So, a <strong>standard</strong> record, which does <strong>not</strong> contain any <strong>comma</strong> in text, should contain <strong><code>18</code></strong> colums, separated by <strong><code>17</code></strong> <strong>comma</strong> delimiter. Your file contains <strong><code>13,126</code></strong> of these <strong>standard</strong> records</p>
<p dir="auto">For theses ones, it’s not very difficult to change any <strong>comma</strong> delimiter with a <strong>semicolon</strong> delimiter. However, note that your file <strong>already</strong> contains <strong><code>114</code></strong> semicolon :-((. So, I would suggest you to use, for instance, the <strong>Tabulation</strong> character ( <strong><code>\t</code></strong> ) as a <strong>delimiter</strong></p>
<p dir="auto">We’ll proceed in <strong>two</strong> steps :</p>
<p dir="auto"><strong>A)</strong> The following <strong>regex</strong> S/R will add a <strong>dummy</strong> character ( <strong><code>@</code></strong> ) , <strong>non-existant</strong> in your file, at the <strong>end</strong> of any of these <strong>standard</strong> lines</p>
<p dir="auto">SEARCH <strong><code>^([^,\r\n]*?,){17}[^,\r\n]+$</code></strong></p>
<p dir="auto">REPLACE <strong><code>$0@</code></strong></p>
<p dir="auto"><strong>B)</strong> The following <strong>regex</strong> S/R will replace any <strong>comma</strong> with a <strong>tabulation</strong> char , only if the line <strong>ends</strong> with the <strong>dummy</strong> char <strong><code>@</code></strong> and will, also, delete the <strong>dummy</strong> character <strong><code>@</code></strong>, when <strong>all</strong> commas of the <strong>current</strong> line have been replaced</p>
<p dir="auto">SEARCH <strong><code>(,)(?=.*@)|@</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1\t</code></strong></p>
<hr />
<p dir="auto">Now, the <strong>bad</strong> news is that the <strong>other</strong> records, of your file, do <strong>not</strong> have a <strong>regular</strong> structure ! For instance, here are, below, a few <strong>non-standard</strong> lines, sorted <strong>alphabetically</strong>.  Rather difficult to link the parts of <strong>each</strong> line to the different areas of the <strong>header</strong> !?</p>
<pre><code class="language-diff">-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 12,851    ""Commander, I have my reasons to believe that you will grasp what I have to say. I am an ambassador from another civilization which conquered space long ago. My mission here is done and I assure you that I have the best possible impression of your people. I shall advocate for you in the Galactic Council. Now I know I have to disappear for the good of everyone. Don't look for me, for you will not find me.
Line 12,685    ""Why me?""
Line 11,980    ","
Line 11,981    ",,,OK,,,,,Trunk\Mars/Dlc/armstrong/Presets/PopupNotificationPreset.lua(00065),,,narrator,narrator,239549,0,
Line  5,573    'An anonymous yet reliable source disclosed to us that you ordered and succeeded in the deliberate destruction of at least one of the alien vessels. My country condemns any premature aggressive actions which could taint the reputation of humankind, especially when addressing such a delicate matter. What gave you the authority to act in such a risky manner without an official resolution from the Council of the United Nations?'","They handle most of the questions with ease and require little input from you. And then you are confronted with a direct question from one of the delegates.
Line  6,519    'Yes, I’m aware. I think she might be evolving into something bigger.'
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 20,816    (Hold) Infopanel shortcuts",,,,new,,,,,Trunk\Mars/Lua/XTemplates/GamepadControlsOverview.lua(00375),XTemplate GamepadControlsOverview Text,,,,234062,,43
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line  2,566    - 5 extra starting technologies
Line 14,132    - &lt;em&gt;Advanced Orbital Probe&lt;/em&gt; - scans five sectors
Line 14,142    - Additional Rockets are significantly cheaper
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line  3,106    1. Select the Spacebar and &lt;right_click&gt; on one of the work slots in the first 2 shifts until the slot is shown in red.
Line  2,950    4. Press &lt;ButtonA&gt; near the marked area above the main base as an end point of the route.",,,,new,,,,,Trunk\Mars/Data/OnScreenHint.lua(00801),OnScreenHint Tutorial_2_TranportRoutes gamepad_text,,,,230265,,347
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 15,426    17,"Period, base (s)",,,,new,,,,,Trunk\Mars/Lua/Buildings/Anomaly.lua(00407),,,,,221724,,16
               ...........................
               ..  Increasing numbers,  ..
               ...........................
Line  9,803    999445241150,"Now an entire Dome suffers from depression and project it back towards the Empath, making things even worse. Your head thumps with the pain and despair felt by the empath &lt;DisplayName&gt; while you’re trying to think out a solution to the crisis.
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 19,431    &lt;/if&gt;&lt;if(skipped)&gt;The following mods will not be loaded because of missing or incompatible dependencies:
Line  2,665    &lt;ButtonA&gt; - land the Rocket",,,,new,,,,,Trunk\Mars/Data/OnScreenHint.lua(00026),OnScreenHint HintRocket gamepad_text,,,,223160,,136
Line  3,843    &lt;ColonistName(colonist)&gt;’s life has been a journey towards a vision, a journey which brought us all towards the possibility of living on the Red Planet, one small step after at a time. &lt;ColonistName(colonist)&gt; didn’t try to make their mark in human history, for there is no room for attempts in success. &lt;ColonistName(colonist)&gt; knew what the calling of fate was, knew the risks and the opportunities and made the best of it, for the good of us all.
Line 20,600    &lt;CompletedText&gt;&lt;/if&gt;",,,,new,,,,,Trunk\Mars/Lua/XTemplates/ChallengeListItem.lua(00009),XTemplate ChallengeListItem RolloverText,,,,236165,,110
Line  8,183    &lt;DisplayName&gt; has been nominated for a Nobel Prize in medical research, followed by a flood of donations and new applicants wanting to become part of our colony.
Line 19,250    &lt;MaintenanceText&gt;",,Building condition deteriorates over time. Martian dust and disasters contribute to deterioration of outside buildings. Deteriorated buildings will need to be serviced by a Drone and to be supplied with their required maintenance resource or they will malfunction.&lt;newline&gt;&lt;newline&gt;Current deterioration&lt;right&gt;&lt;percent(MaintenanceProgress)&gt;&lt;newline&gt;&lt;left&gt;Last serviced&lt;right&gt;&lt;LastMaintenance&gt;,The condition of buildings deteriorates over time. Martian dust and disasters contribute to deterioration of outside buildings. Deteriorated buildings will need to be serviced by a Drone and supplied with their required maintenance resource or they will malfunction.&lt;newline&gt;&lt;newline&gt;Current deterioration&lt;right&gt;&lt;percent(MaintenanceProgress)&gt;&lt;newline&gt;&lt;left&gt;Last serviced&lt;right&gt;&lt;LastMaintenance&gt;,changed,,,,,Trunk\Mars/Lua/RequiresMaintenance.lua(00539),XTemplate sectionMaintenance RolloverText,,,,233244,,72
Line 20,835    &lt;ShortcutName('actionSpeedDown')&gt; -  decrease game speed
Line 21,747    &lt;UIRefundRes&gt; will be refunded upon salvage.",,,,new,,,,,Trunk\Mars/Lua/XTemplates/ipMultiSelect.lua(00119),XTemplate ipMultiSelect RolloverText,,,,240619,0,72
Line  1,420    &lt;center&gt;&lt;image UI/Common/rollover_line.tga 2000&gt; &lt;left&gt;
Line  8,569    &lt;colonists_pissed_1&gt;% of Religious Colonists lose &lt;morale_loss&gt; Morale for &lt;sols(pissed_time)&gt; Sols.
Line  2,322    &lt;cut_if_not_platform('desktop')&gt;
Line 20,476    &lt;dependencies&gt;
Line 12,314    &lt;drones_lost&gt; Drones have been lost.
Line  4,784    &lt;effect&gt;  We discovered 30 Rare Metals at the anomaly site","After minimal processing, the resources can be transported and put to good use for the benefit of the Colony.
Line 11,811    &lt;em&gt;Water&lt;/em&gt; is increased by evaporation from &lt;em&gt;Lakes&lt;/em&gt; and by completing &lt;em&gt;Special Projects&lt;/em&gt;.
Line 20,268    &lt;formatedbuildinginfo('ElectricitySwitch')&gt;",,,,new,,,,,Trunk\Mars/Lua/X/BuildMenu.lua(00916),,,,,226204,,58
Line  9,111    &lt;funding(offered_funding)&gt; in exchange for &lt;base_price_reduction&gt;% of all revenue earned from any Rare Metal exports we make in the future. ",,,,new,,,,,Trunk\Mars/Data/StoryBit/MutualInterests.lua(00032),StoryBit MutualInterests Text,,,,234708,,167
Line 13,490    &lt;goal&gt;You will be put through a series of trials. Metatron will create waves of anomalies which will test your ingenuity and resolve. Adapt and survive!
Line 10,677    &lt;grey&gt;""All fungi are edible. Some fungi are only edible once.""
Line 11,167    &lt;grey&gt;'We should not just consume hydrocarbon fuel but use it to develop nuclear energy, hydro power and renewable energy sources.'
Line 11,325    &lt;grey&gt;A friendly and supportive community is the key to making life easier in the harsh reality of the Red Planet.&lt;/grey&gt;",,"Residential buildings Upgrade (&lt;em&gt;Home Collective&lt;/em&gt;) - increases the Service Comfort of the building by 10.
Line 10,712    &lt;grey&gt;“One touch of nature makes the whole world kin.”
Line 20,464    &lt;hard&gt;
Line  4,752    &lt;hint&gt; Check the map for the new locations","On July 7th, 1988 the Soviet Union launched two Proton-K rockets carrying the Phobos-1 and Phobos-2 probes on a course to Mars. Of the two craft only Phobos-2 reached its final destination, but contact with it was lost just before it could deliver its precious payload.
Line 20,599    &lt;if(Completed)&gt;
Line 10,880    &lt;if(has_dlc('contentpack3'))&gt;New Building: &lt;em&gt;Large Oxygen Tank&lt;/em&gt; (&lt;buildinginfo('OxygenTank_Large')&gt;) - stores very large amounts of oxygen.&lt;/if&gt;
Line 15,338    &lt;left&gt;Collaboration loss&lt;right&gt;&lt;EstimatedDailyLoss&gt;
Line 13,696    &lt;list&gt;",,,,new,,,,,Trunk\Mars/Dlc/gagarin/Code/RivalColonies.lua(00613),,,,,235024,,60
Line 19,429    &lt;mods&gt;
Line 12,293    &lt;morale_percent&gt;% Engineer colonists lose &lt;morale_loss&gt; Morale for &lt;sols(morale_sols)&gt; Sols.",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/StoryBit/ThoseDirtyShuttles_FollowUp_opt.lua(00170),StoryBit ThoseDirtyShuttles_FollowUp_opt Text,,,,242226,0,320
Line  8,563    &lt;new_saints&gt; more Colonists have become Saints.",,,,new,,,,,Trunk\Mars/Data/StoryBit/ForeignerInAForeignLand_FollowUp2.lua(00088),StoryBit ForeignerInAForeignLand_FollowUp2 Text,,,,238668,0,601
Line    672    &lt;platform_specific_text&gt;",,,,new,,,,,Trunk\CommonLua/ParadoxMenu.lua(00157),,,,,238668,,90
Line  7,049    &lt;reg_param1&gt; has sent a request that we start accepting refugees. They hope this drastic measure to get people to safety will highlight the absurdity of regional governments not taking in refugees and put pressure on them by their own populace.
Line 11,078    &lt;right&gt;Wilson Greatbatch&lt;/grey&gt;&lt;left&gt;",,,,new,,,,,Trunk\Mars/Data/TechPreset.lua(02278),TechPreset FusionAutoregulation description,,,,228384,,315
Line 21,399    &lt;right_click&gt; Cancel Biorobot &lt;newline&gt;&lt;center&gt;Ctrl + &lt;left_click&gt; Construct five Biorobots",,,,new,,,,,Trunk\Mars/Lua/XTemplates/customDroneFactory.lua(00044),XTemplate customDroneFactory RolloverHint,,,,230711,,123
Line  8,584    &lt;security_happy&gt;% of Security Officers gain &lt;morale_gain&gt; Morale for &lt;sols(happy_time)&gt; Sols.",,,,new,,,,,Trunk\Mars/Data/StoryBit/ForeignerInAForeignLand_FollowUp2.lua(00217),StoryBit ForeignerInAForeignLand_FollowUp2 Text,,,,238668,0,343
Line 19,433    &lt;skipped&gt;
Line xx,xxx    &lt;skipped&gt;",,,,new,,,,,Trunk\CommonLua/Classes/Mod.lua(01802),,,,,243121,0,97
Line 20,468    &lt;soft&gt;
Line  9,698    &lt;sponsor_name&gt; has suspended the construction of any new Fusion Reactors until investigations are complete.
Line  6,350    &gt;&gt;&gt; You want me to ask you a question?
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 12,113    A Marsquake has just started.",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/StoryBit/BabyVolcano.lua(00135),StoryBit BabyVolcano Text,,,,243013,0,433
Line  2.822    Zoom - &lt;middle_click&gt; or &lt;em&gt;PgUp/PgDown&lt;/em&gt;
-------------------------------------------------------------------------------------------------------------------------------------------------------
Line 13,508    ‘Adapt, expand, evolve.’ These are its words.
Line  6,515    “Yes, I’m aware. I think she might be evolving into something bigger.”
-------------------------------------------------------------------------------------------------------------------------------------------------------
</code></pre>
<p dir="auto">For instance, the line <strong><code>9,803</code></strong>, above, contains <strong>only</strong> <strong><code>2</code></strong> commas !!</p>
<hr />
<p dir="auto">Even <strong>worse</strong>, assuming, for instance, the <strong>standard</strong> line <strong><code>12,687</code></strong>, below, containing <strong><code>17</code></strong> <strong>commas</strong>, as expected :</p>
<pre><code class="language-diff">""'Cause you're the Commander, of course"" - she looks disappointed how silly adults are. ""Will you come?""",,,,new,,,,,Trunk\Mars/Dlc/armstrong/Presets/StoryBit/Pyramid_FollowUp_Xenoform_1a.lua(00033),StoryBit Pyramid_FollowUp_Xenoform_1a Text,,,,242226,0,341
</code></pre>
<p dir="auto">It contains <strong><code>5</code></strong> <strong>double-quote</strong> chars ( <strong><code>"</code></strong> ). Obviously, not an <strong>even</strong> number :-(( So, how to <strong>easily</strong> separate the different zones ?</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47949</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47949</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 24 Nov 2022 12:03:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 20 Oct 2019 15:36:30 GMT]]></title><description><![CDATA[<p dir="auto">sorry now is pubblic</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47944</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47944</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Sun, 20 Oct 2019 15:36:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 20 Oct 2019 07:48:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: Andrew-Staibuz">@<bdi>Andrew-Staibuz</bdi></a><br />
page that you are shared is not actually shared to public<br />
we have not permission<br />
<a href="https://drive.google.com/file/d/1_vHlq3znkYVYfAAbuw4R2n0I1wp5iYj6/view?usp=sharing" rel="nofollow ugc">https://drive.google.com/file/d/1_vHlq3znkYVYfAAbuw4R2n0I1wp5iYj6/view?usp=sharing</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/47935</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47935</guid><dc:creator><![CDATA[rinku singh]]></dc:creator><pubDate>Sun, 20 Oct 2019 07:48:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sun, 20 Oct 2019 07:39:46 GMT]]></title><description><![CDATA[<p dir="auto">First of all thanks you both for your help.<br />
Surely I haven’t given you an accurate representation of my text because it’s more complicated than I expected.<br />
So below you can find the link to take a look to the file I want to edit (that is the localization file of Surviving Mars).<br />
I want to translate it in my own language and do it in the simplest way possible.<br />
So I open it with Notepad ++<br />
Then I try to transform comma in semicolon to better separate the text from the separator.<br />
Only at this point I import the file in Excel to put in a column the data.<br />
As you can see not all the strings have a quote at the start and at the end.<br />
Some strings contain comma that aren’t separator.<br />
Not all the strings are edit in the same way.</p>
<p dir="auto">I hope that explanation help you</p>
<p dir="auto">[<a href="https://drive.google.com/file/d/1_vHlq3znkYVYfAAbuw4R2n0I1wp5iYj6/view?usp=sharing" rel="nofollow ugc">https://drive.google.com/file/d/1_vHlq3znkYVYfAAbuw4R2n0I1wp5iYj6/view?usp=sharing</a>](link url)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47934</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47934</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Sun, 20 Oct 2019 07:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 19 Oct 2019 18:24:01 GMT]]></title><description><![CDATA[<p dir="auto">I even noticed in the forum’s code-highlighting of the example text, it knows what a CSV looks like:</p>
<pre><code>malformed:
504780607315,"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!, oldtext, other
</code></pre>
<p dir="auto">vs</p>
<pre><code>correct CSV:
504780607315,"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!", oldtext, other
</code></pre>
<p dir="auto">Notice how it stops being green after the end-quote.</p>
<p dir="auto">Or, a shorter example:</p>
<pre><code>malformed,"this quote opened it,blah,blah
yada,",notice that yada comma is still part of the string started on the previous row, new column, new column
vs
correct,"this quote is complete",blah,blah
yada,notice that here, yada is not green
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/47922</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47922</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Oct 2019 18:24:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 19 Oct 2019 18:19:18 GMT]]></title><description><![CDATA[<p dir="auto">because when I tried <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a>’s regex on the following two lines of data:</p>
<pre><code>504780607315,"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!, oldtext, other
123456789012,"this text has a bunch of commas,,,,,,,,,,,which are all real, but the last two commas, coming soon, should be preserved, oldtext, other
</code></pre>
<p dir="auto">I got</p>
<pre><code>504780607315;"Today the sun rose above a scene so spectacularly normal, that it was everything but. Blueish skies hanging above the arid, grassy fields of what might as well have been the great plains of Utah… But was actually here, on Mars!; oldtext; other
123456789012;"this text has a bunch of commas,,,,,,,,,,,which are all real, but the last two commas, coming soon, should be preserved; oldtext; other
</code></pre>
<p dir="auto">Which is exactly what I would expect from your description of the problem.</p>
<p dir="auto">So either you’re doing something wrong, or you haven’t given us an accurate representation of your text, or your definition of “doesn’t work” includes something different than “the regex didn’t transform the text the way I described it should”</p>
<p dir="auto">If by “it doesn’t work”, you mean that Excel didn’t read the CSV the way you intended it to:</p>
<ol>
<li>
<p dir="auto">Did you tell Excel that you wanted semicolon as the separator?</p>
</li>
<li>
<p dir="auto">Did you know that your CSV is horribly mis-formed, even after the replacement?</p>
<ul>
<li>In a CSV file, if there’s a quote at the start of a given column, compliant CSV parsers (including Excel) will expect a closing quote as well; anything between those quotes will be considered part of that one column, including any separator characters embedded in the text.</li>
<li>So <code>12345,"hello,,,,,,world",three</code> has three columns: <code>12345</code>, then <code>hello,,,,,,world</code>, then finally <code>three</code>.</li>
<li>But if your text is missing the end-quote (and the example text you showed <em>is</em> missing the end-quote – unless the forum mangled your text because you forgot to use the <code>&lt;/&gt;</code> button in the forum editor to mark the text as “code”, so that it wouldn’t interpret it as Markdown), then I think Excel will continue looking on the next line for the end-quote.  (I’m not sure, and I don’t have Excel on my home machine, so cannot test).</li>
</ul>
</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/47921</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47921</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Oct 2019 18:19:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 19 Oct 2019 17:51:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: Andrew-Staibuz">@<bdi>Andrew-Staibuz</bdi></a> said in <a href="/post/47918">How to locate text separators and replace them?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said in <a href="/post/47916">How to locate text separators and replace them?</a>:</p>
<blockquote>
<p dir="auto">\1;\2;\3;\4</p>
</blockquote>
<p dir="auto">Thank you for your replay but it seems doesn’t work proprely</p>
</blockquote>
<p dir="auto">Did you remember to enable regular expression mode in the search-and-replace dilog?</p>
<p dir="auto">Can you explain what didn’t work properly?  What did that regex generate, and how did it not match what you want?  (using the <code>&lt;/&gt;</code> button to markup example text will remove ambiguity)</p>
<p dir="auto">We’d love to help, but we need you to help us help you by supplying more information</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47919</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47919</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Oct 2019 17:51:04 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 19 Oct 2019 17:29:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said in <a href="/post/47916">How to locate text separators and replace them?</a>:</p>
<blockquote>
<p dir="auto">\1;\2;\3;\4</p>
</blockquote>
<p dir="auto">Thank you for your replay but it seems doesn’t work proprely</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47918</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47918</guid><dc:creator><![CDATA[Andrew Staibuz]]></dc:creator><pubDate>Sat, 19 Oct 2019 17:29:23 GMT</pubDate></item><item><title><![CDATA[Reply to How to locate text separators and replace them? on Sat, 19 Oct 2019 14:20:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-staibuz" aria-label="Profile: Andrew-Staibuz">@<bdi>Andrew-Staibuz</bdi></a></p>
<p dir="auto">from the given example this might do the job<br />
find what: <code>^(.*?),(.*),(.*?),(.*?)$</code><br />
replace with:<code>\1;\2;\3;\4</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/47916</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47916</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Sat, 19 Oct 2019 14:20:21 GMT</pubDate></item></channel></rss>