title: Custom format ID mapping
body: <p>I have two databases (txt files). One is a two-column, tab-delimited one, that holds names and IDs.</p>
  
  <pre><code>name1 \t ID1
  name1 \t ID2
  name2 \t ID9
  name2 \t ID40
  name3 \t ID3
  </code></pre>
  
  <p>The other database has the same IDs as the first one in the first column, while the second column lists IDs of the same kind delimited by commas (these are the children of the ones in the first one, as the second database is hierarchical).</p>
  
  <pre><code>ID1 \t ID1,ID2,ID3
  ID2 \t ID2, ID9
  </code></pre>
  
  <p>What I would like to do is get a third database with the same format as the second, but in the second column I'd like to swap out the children IDs to the names of the first database. For example:</p>
  
  <pre><code>ID1 \t name1,name2,name3
  ID2 \t name1,name2
  </code></pre>
  
  <p>Is there a way to do this? I'm quite the beginner, when I had to map IDs before I used web services, but this is a custom format needed for further analysis and I'm not sure where to start.</p>
  
  <p>Thanks in advance!</p>