title: Concatenate output of multiple processes to StreamReader
body: <p>I need to capture the ouput of three processes and pass it as a <code>StreamReader</code>. Is this possible in C#?</p>
  
  <p>Background: I need the output of another file with three different arguments, but I want to treat the "complete" output (all three together) for latter processing in my code.</p>
  
  <p>Should I just call the process three times and process the output in a loop? Or is there a more efficient way?</p>
  
  <p>Currently, I'm doing it like this</p>
  
  <pre><code>if (String.IsNullOrEmpty(file))
  {
      Process dsget;
      dsget = Process.Start("dsget", "group \"CN=COUNTRY_DE,DC=cms,DC=local\" -members");
      dsget.StartInfo.UseShellExecute = false;
      dsget.StartInfo.RedirectStandardOutput = true;
      dsget.Start();
      reader = dsget.StandardOutput;
  }
  else 
  {
      reader = new StreamReader(file);
  }
  while ((line = reader.ReadLine()) != null)
  {
      if (!line.Contains("CN"))
          continue;
      string username = line.Replace("\"", "").Split(',')[0].Split('=')[1];
      countryUsers.Add(username.ToUpperInvariant());
  }
  </code></pre>
  
  <p>But I need two more <code>COUNTRY_XX</code>-groups from "dsget".</p>