<?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[Split Field Into Two Fields]]></title><description><![CDATA[<p dir="auto">I am very new to Notepad++ so not sure if I’m wording this right, but I have a txt file where each record is a specific length.  I have an Address “field” that is 100 character wide (padded with spaces) that starts at character 56…  If the street address is two lines, both lines are in that field, separated by a tilde.  I need the part after the tiled moved so that I basically have two 50 character fields.  So, to give an example, this</p>
<p dir="auto">In Care of John Doe~1000 John Street                                                     Hobbs               NM   88240</p>
<p dir="auto">would become</p>
<p dir="auto">In Care of John Doe                           1000 John Street                            Hobbs               NM   88420</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14351/split-field-into-two-fields</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 10:31:57 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14351.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Aug 2017 13:57:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Split Field Into Two Fields on Thu, 24 Aug 2017 13:57:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/kasey-gonzales" aria-label="Profile: kasey-gonzales">@<bdi>kasey-gonzales</bdi></a>,</p>
<p dir="auto">Thanks to <strong>Scott</strong>, we can figure out your problem, much better ! So, as your address field is <strong>100</strong> characters wide, in case of a <strong>two-lines</strong> address, each part, <strong>before</strong> and <strong>after</strong> the <strong>tilde</strong> character ( <strong><code>~</code></strong> ), have a <strong>maximum</strong> of <strong>50</strong> characters and, of course, a <strong>minimum</strong> of <strong>1</strong> character.</p>
<p dir="auto">Thus, given, for instance, the <strong>original</strong> text, below ( By convention, I’m using <strong>digits</strong> in the <strong>first</strong> part address, before the <strong><code>~ </code></strong> and <strong>upper-case</strong> letters, in the <strong>second</strong> part, <strong>after</strong> the <strong><code>~</code></strong> character, both between <strong>1</strong> and <strong>50</strong> characters long )</p>
<pre><code class="language-diff">---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0---------1---------2---------3---------4---------5---------6
                                                       1~A
                                                       1~ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ
                                                       12345678901234567890123456789012345678901234567890~A
                                                       12345678901234567890123456789012345678901234567890~ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ

                                                       In Care of John Doe~1000 John Street Hobbs NM 88240
</code></pre>
<p dir="auto">I would propose <strong>two</strong> steps :</p>
<ul>
<li>A FIRST <strong>normal</strong> OR <strong>regex</strong> search / replacement, which adds <strong>50 space</strong> characters, <strong>in front of</strong> the <strong><code>~</code></strong> symbol :</li>
</ul>
<pre><code class="language-diff">SEARCH  :~

REPLACE :                                                  ~
</code></pre>
<ul>
<li>A SECOND <strong>regex</strong> search / replacement, right after, which deletes any <strong>consecutive</strong> range of <strong>space</strong> characters, between position <strong>106</strong> and the <strong><code>~</code></strong> symbol :</li>
</ul>
<pre><code class="language-diff">SEARCH  :(?-s)^(.{105}) +~

REPLACE :\1
</code></pre>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto"><strong>Copy/paste</strong>, in the <strong>Replace</strong> dialog, each zone, selecting text <strong>AFTER</strong> the <strong>colon</strong> character</p>
</li>
<li>
<p dir="auto">In the <strong>second</strong> search regex <strong><code>^(.{105}) +~</code></strong>, there is a <strong>space</strong> character, before the <strong><code>+</code></strong> symbol</p>
</li>
<li>
<p dir="auto">Select the <strong>Regular expression</strong> mode</p>
</li>
<li>
<p dir="auto">In the <strong>second</strong> replacement regex, we just re-write the <strong>group 1</strong> ( the <strong>first 105</strong> characters of <strong>each</strong> line )</p>
</li>
<li>
<p dir="auto">These two <strong>S/R</strong>  <strong>preserves</strong> any text which is <strong>before</strong> column <strong>56</strong> , and <strong>after</strong> the <strong>second</strong> part of the <strong>address</strong> field</p>
</li>
</ul>
<hr />
<p dir="auto">Then, after these <strong>two consecutive</strong> regex S/R, you should obtain the text, below, with the <strong>second</strong> part address <strong>moved</strong> to column <strong>106</strong> :</p>
<pre><code class="language-diff">---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0---------1---------2---------3---------4---------5---------6
                                                       1                                                 A
                                                       1                                                 ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ
                                                       12345678901234567890123456789012345678901234567890A
                                                       12345678901234567890123456789012345678901234567890ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ

                                                       In Care of John Doe                               1000 John Street Hobbs NM 88240
</code></pre>
<p dir="auto">IMPORTANT :</p>
<ul>
<li>
<p dir="auto">If your text may contain some <strong>tabulation</strong> characters, just <strong>change</strong> them by the <strong>appropriate</strong> number of <strong>space</strong> characters, using the <strong>Edit - Blank Operations - TAB to Space</strong> menu option !</p>
</li>
<li>
<p dir="auto">If your text may contain <strong>other</strong> <strong><code>~</code></strong> characters, located <strong>outside</strong> the <strong>address</strong> field, just tell me and we’ll slightly change the <strong>first</strong> search !</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26427</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26427</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 24 Aug 2017 13:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to Split Field Into Two Fields on Wed, 23 Aug 2017 14:22:07 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that’s more what my before and after is supposed to look like…thanks!</p>
<p dir="auto">And yes, there is non-blank data to the left and right.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26402</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26402</guid><dc:creator><![CDATA[Kasey Gonzales]]></dc:creator><pubDate>Wed, 23 Aug 2017 14:22:07 GMT</pubDate></item><item><title><![CDATA[Reply to Split Field Into Two Fields on Wed, 23 Aug 2017 14:16:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasey-gonzales" aria-label="Profile: Kasey-Gonzales">@<bdi>Kasey-Gonzales</bdi></a></p>
<p dir="auto">I think you might be a “victim” of the “markdown” syntax used on this site in trying to show your “before” and “after” text.</p>
<p dir="auto">Maybe you are trying to say this:</p>
<pre><code>---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0---------1---------2---------3---------4---------5---------6
                                                       In Care of John Doe~1000 John Street Hobbs NM 88240                                                 |
                                                       In Care of John Doe                               1000 John Street Hobbs NM 88240                   |
</code></pre>
<p dir="auto">I added a “ruler line” with every 10 columns called out; also a vertical bar at the end of what I think would be your “before” and “after” lines.</p>
<p dir="auto">I really don’t know if this is correct or not.  You probably have non-blank data to the left of column 56.  And maybe to the right.</p>
<p dir="auto">Anyway if you want to show your before and after data better, here’s the key:  Indent each line with 4 spaces when you paste into this site.  Then it will become what is known as a “code block” (the black box above).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26401</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26401</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 23 Aug 2017 14:16:33 GMT</pubDate></item></channel></rss>