title: batching file strings by itemgroup metadata in msbuild
body: <p>How to batch strings from files by the metadata passed in itemgroup along with the file names?</p>
  
  <p>Here is what i've got so far, but can't figure out how to pass initial itemgroups metadata <code>Level</code> to the resulting item group <code>Lines</code>:</p>
  
  <pre><code>&lt;ItemGroup&gt;
   &lt;LogFile Include="1.log"&gt;
     &lt;Level&gt;Warning&lt;/Level&gt;
   &lt;/LogFile&gt;
   &lt;LogFile Include="2.log"&gt;
     &lt;Level&gt;Warning&lt;/Level&gt;
   &lt;/LogFile&gt;
   &lt;LogFile Include="3.log"&gt;
    &lt;Level&gt;Error&lt;/Level&gt;
   &lt;/LogFile&gt;
  &lt;ItemGroup&gt;
  
  &lt;ReadLinesFromFile
      File="@(LogFile)" &gt;
      &lt;Output
          TaskParameter="Lines"
          ItemName="LogMessage"/&gt;
  &lt;/ReadLinesFromFile&gt;
  
  &lt;Message Text="%(LogMessage.Identity)" /&gt;
  </code></pre>
  
  <p>What i want to get is:</p>
  
  <pre><code>Warning: (lines from 1.log&gt;
  Warning: (lines from 2.log&gt;
  Error: (lines from 3.log)
  </code></pre>
  
  <p>where Warning and Error is given by %(LogFile.Level)</p>