title: Splitting Lines, Mapping, and Merging to Text File In C#
body: <p>For example, I have an <strong>input text file "FILE1.txt"</strong> that reads</p>
  
  <pre><code>000123400056780001324
  000556700034520004758
  </code></pre>
  
  <p>Here, the first 7 numbers = item 1, the next = item 2 and so on.</p>
  
  <p>And another <strong>input map text file "MAPFILE.txt"</strong> that reads</p>
  
  <pre><code>0003452 itema
  0001324 itemb
  0005567 itemc
  0004758 itemd 
  </code></pre>
  
  <p>Where lets say, column 1 are item numbers (7 chars) and column 2 is description (5 chars).</p>
  
  <p>And a pre-existing text file in my project that I added so that I can write the output to it. Let's call it "OUTPUT.txt" -</p>
  
  <p><code>S.No    Item1    Desc1    Item2   Desc2     Item3  Desc3</code> </p>
  
  <p>So ULTIMATELY, I need to get</p>
  
  <pre><code>S.No   Item1       Desc1      Item2      Desc2     Item3     Desc3
  
  1      0001234     *          0005678    *         0001324   itemb
  2      0005567     itemc      0003452    itema     0004758   itemd
  </code></pre>
  
  <p>I have around 100 lines like these. <strong>How do I split FILE1 line by line and then map those item number substrings to the ones in MAPFILE and finally merge them into the OUTPUT.txt I've already added into my project?</strong> I'm a beginner and I'm just starting out. I've broken my solution down into steps this way, but how do I go about this?</p>
  
  <p>Thanks a lot!</p>