<?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[Delete characters that exceed the number of characters between the 11th and 12th occurence of "]]></title><description><![CDATA[<p dir="auto">Hello everyone,<br />
I have many lines, which look like this:</p>
<p dir="auto">“TRX_TT_ID”;“TRX_APP_DD”;“ORIGIN”;“SUB_TYPE”;“NUMBER”;“<strong>TABLE_TRX_LNR</strong>”;“DATABANK_NUMBER”;“STATE”;“CVBT_ISO_LKZ”;“PRODUKT”<br />
“1000”;“1”;“1”;“”;“834600000”;“<strong>13340000 2227</strong>”;“1082803 / 13341837 2227”;“1”;“EN”<br />
“1000”;“1”;“1”;“”;“834600000”;“<strong>13350001 33 This is very long and needs to be truncated</strong>”;“1080668 / 13341845 This is technical”;“1”;“EN”;“Call”</p>
<p dir="auto">The text between occurence no. 11 and 12 of " needs to be trimmed after the first 10 characters (that column must have maximum 10 characters).</p>
<p dir="auto">Can anyone please help out?<br />
Thank you!<br />
Cristian</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21018/delete-characters-that-exceed-the-number-of-characters-between-the-11th-and-12th-occurence-of</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 20:04:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21018.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Apr 2021 12:37:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Delete characters that exceed the number of characters between the 11th and 12th occurence of " on Tue, 13 Apr 2021 15:53:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-tanasa" aria-label="Profile: Cristian-tanasa">@<bdi>Cristian-tanasa</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">I <strong>improved</strong> and generalized the process with these <strong><code>8</code></strong> <strong>new</strong> search regexes, in order to find <strong>part</strong> of a <strong>particular</strong> field <strong><code>n</code></strong></p>
<p dir="auto">Of course, I assume that :</p>
<ul>
<li>
<p dir="auto"><strong>Each</strong> row of the table contains the <strong>same</strong> number of fields</p>
</li>
<li>
<p dir="auto">The field <strong>delimiter</strong> is the <strong>double quote</strong> char ( <strong><code>"</code></strong> )</p>
</li>
<li>
<p dir="auto">The field <strong>separator</strong> is the <strong>semicolon</strong> ( <strong><code>;</code></strong> )</p>
</li>
<li>
<p dir="auto">Any field is <strong>preceded</strong> and/or <strong>followed</strong> with a <strong><code>;</code></strong></p>
</li>
<li>
<p dir="auto">Any char, <strong>within</strong> a field, is <strong>different</strong> from, either, a <strong><code>"</code></strong> and a <strong><code>;</code></strong> chars</p>
</li>
</ul>
<hr />
<p dir="auto">Here are these <strong>generic</strong> regexes :</p>
<pre><code class="language-z">(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} "          \K (?1)*          #  ALL chars, even NONE,                     of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} " (?1){#}  \K (?1)*          #  ALL chars, even NONE, AFTER the #th char  of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} " (?1){#}  \K (?1){p}        #  p chars,              AFTER the #th char  of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} "          \K (?1){p}        #  The p FIRST chars                         of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} " (?1)*    \K (?1){p} (?=")  #  The p LAST  chars                         of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} "          \K                #  EMPTY string, at BEGINNING                of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} " (?1){#}  \K                #  EMPTY string, AFTER the #th char          of FIELD n
(?x) ^ (?: " ( [^";\r\n] )* " ; ) {n-1} " (?1)*    \K                #  EMPTY string, at END                      of FIELD n
</code></pre>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">Let <strong><code>f</code></strong> be the <strong>total</strong> number of fields and let <strong><code>m</code></strong> be the <strong>maximum</strong> number of characters of the <strong>field</strong> <strong><code>n</code></strong>. Then :</p>
<ul>
<li>
<p dir="auto">The variable <strong><code>n</code></strong> is between the values <strong><code>1</code></strong> <strong>included</strong> and <strong><code>f</code></strong> <strong>included</strong> ( So <strong><code>n-1</code></strong> is in range <strong><code>[0,f-1]</code></strong> )</p>
</li>
<li>
<p dir="auto">The variable <strong><code>#</code></strong> is between the values <strong><code>0</code></strong> <strong>included</strong> and <strong><code>m</code></strong> <strong>included</strong></p>
</li>
<li>
<p dir="auto">The variable <strong><code>p</code></strong> is between the values <strong><code>0</code></strong> <strong>included</strong> and <strong><code>m</code></strong> <strong>included</strong></p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto">Let’s test these <strong><code>8</code></strong> <strong>real</strong> regexes, below :</p>
<pre><code class="language-z">(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  "          \K (?1)*          #  ALL chars, even NONE,                     of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  " (?1){10} \K (?1)*          #  ALL chars, even NONE, AFTER the 10th char of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  " (?1){10} \K (?1){3}        #  THREE chars,          AFTER the 10th char of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  "          \K (?1){5}        #  The 5 FIRST chars                         of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  " (?1)*    \K (?1){7} (?=")  #  The 7 LAST  chars                         of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  "          \K                #  EMPTY string, at BEGINNING                of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  " (?1){10} \K                #  EMPTY string, AFTER the 10th char         of FIELD 6
(?x) ^ (?: " ( [^";\r\n] )* " ; )  {5}  " (?1)*    \K                #  EMPTY string, at END                      of FIELD 6
</code></pre>
<p dir="auto">Against the following <strong>sample</strong> text :</p>
<pre><code class="language-diff">                           Field 6
                               V
"1000";"1";"1";"";"834600000";"";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"123";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1234";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12345";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"123456";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1234567";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12345678";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"123456789";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1234567890";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12345678901";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"123456789012";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1234567890123";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12345678901234";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"123456789012345";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"1234567890123456";"1080668 / 13341845 This is technical";"1";"EN";"Call"
"1000";"1";"1";"";"834600000";"12345678901234567";"1080668 / 13341845 This is technical";"1";"EN";"Call"
</code></pre>
<p dir="auto"><strong>Super</strong>, isn’t it ?</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64908</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64908</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 13 Apr 2021 15:53:26 GMT</pubDate></item><item><title><![CDATA[Reply to Delete characters that exceed the number of characters between the 11th and 12th occurence of " on Tue, 13 Apr 2021 07:01:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>,</p>
<p dir="auto">oh my God, it worked! :)<br />
It just worked!<br />
Thank you so much for your effective solution! :)</p>
<p dir="auto">Best regards,<br />
Cristian</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64902</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64902</guid><dc:creator><![CDATA[Cristian Tanasa]]></dc:creator><pubDate>Tue, 13 Apr 2021 07:01:32 GMT</pubDate></item><item><title><![CDATA[Reply to Delete characters that exceed the number of characters between the 11th and 12th occurence of " on Tue, 13 Apr 2021 23:45:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/cristian-tanasa" aria-label="Profile: Cristian-tanasa">@<bdi>Cristian-tanasa</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">There still are some points not totally <strong>clear</strong> !</p>
<ul>
<li>
<p dir="auto">Firstly, I suppose that you’re using <strong>regular double</strong> quotes <strong><code>"</code></strong> and <strong>not</strong> the <strong><code>“</code></strong> and <strong><code>”</code></strong> characters !</p>
</li>
<li>
<p dir="auto">Secondly, from the <strong>header</strong> line, <strong>each</strong> row of your table should contain <strong><code>10</code></strong> fields. Apparently, it’s <strong>not</strong> the case of your <strong>first</strong> line, which contains <strong><code>9</code></strong> fields !</p>
</li>
<li>
<p dir="auto">Thirdly, if we <strong>keep</strong> the first <strong><code>10</code></strong> characters, only, of the <strong><code>6th</code></strong> field concerned, we get the string <strong><code>13350001 3</code></strong> ! Do you <strong>expect</strong> such result ?</p>
</li>
</ul>
<hr />
<p dir="auto">In case of a <strong>positive</strong> result :</p>
<ul>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-s)^(?:"([^";\r\n])*";){5}"(?1){10}\K(?1)+(?=")</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button ( Do <strong>not</strong> use the <strong>Replace</strong> button ! )</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; <strong>All</strong> characters,  of the <strong><code>6th</code></strong> field, <strong>after</strong> the <strong><code>10th</code></strong> character, are <strong>deleted</strong> !</p>
<p dir="auto">If a <strong>row</strong> contains a <strong><code>6th</code></strong> field with <strong>less</strong> than <strong><code>11</code></strong> chars, the line is <strong>not</strong> processed !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64878</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64878</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 13 Apr 2021 23:45:51 GMT</pubDate></item></channel></rss>