title: How to append lines to each other based on condition in Bash
body: <p>I have text:</p>
  <pre><code>Fishing tour.png
  Fishing tour2.png
  One Day Tour.png
  Sydney Adventure 3 Days Package.png
  Sydney Northern Beaches Scenic Flight by Seaplane.png
  Week trip.png
  Weekend trip to Baku.png
  Fishing tour a0HR000000B4wMUMAZ    
  One Day Tour a0HR000000B4wMVMAZ    
  Sydney Adventure 3 Days Package a0HR000000B4wMWMAZ    
  Sydney Northern Beaches Scenic Flight by Seaplane a0HR000000B4wSuMAJ   
  Week trip a0HR000000B4wMTMA    
  Weekend trip to Baku a0HR000000B4wMSMAZ
  </code></pre>
  <p>I want to make two conditions.</p>
  <ol>
  <li><strong>Replace</strong> identical words without extension by words with extension, can be any extension (<code>'Fishing tour'</code> replace on <code>'Fishing tour.png'</code>) and remain Id as it is.</li>
  <li>Words with appended number(0-9) <strong>put on new line</strong> with id matching to previous word identical to it (<code>'Fishing tour'</code> replace on <code>'Fishing tour2.png'</code> and remain id of <code>'Fishing tour'</code>, so this id happens twice in text).</li>
  </ol>
  <p>So, desired output should be:</p>
  <pre><code>Fishing tour.png a0HR000000B4wMUMAZ   
  Fishing tour2.png a0HR000000B4wMUMAZ(id is identical as on the line above)    
  One Day Tour.png a0HR000000B4wMVMAZ    
  Sydney Adventure 3 Days Package.png a0HR000000B4wMWMAZ    
  Sydney Northern Beaches Scenic Flight by Seaplane.png a0HR000000B4wSuMAJ    
  Week trip.png a0HR000000B4wMTMAZ   
  Weekend trip to Baku.png a0HR000000B4wMSMAZ
  </code></pre>
  <p>Please, help If someone know how to do this using <code>awk</code> or <code>sed</code> or any other tool that's available in Bash.</p>
  <p>My code attempt:</p>
  <pre><code>sed -E 's/(.+([0-9])?\..+)|.+[[:space:]]([a-zA-Z0-9]+)/\1\3/g'
  </code></pre>