C# stringbuilder + conversion
<p>What I have going on is this:<br>
1) Reading a directory of files<br>
2) Writing out to a text file the filenames + "|"<br>
3) Where i'm stuck.....  </p>

<p>I have a bunch of files named... and need to be converted corispondingly:
Apple0154~3.Txt convertedTO -> Apple0156.txt<br>
Apple0136~31.txt convertedTO -> Apple0166.txt  </p>

<p>The prefix is always apple so it kinda goes like:<br>
Apple (always the same prefix).
The numbers match is # + ~ subnumber -1
always in in .txt</p>

<p>I'm sure this is confusing i'm using this code but i cant figured out how to get this resulting textfile:<br>
  Apple0154~3.Txt|Apple0156.txt<br>
Apple0136~31.txt|Apple0166.txt</p>

<pre><code>{
            string resultingfile = ***This is what i dont know***
            string movedredfolder = (overlordfolder + "\\redactions\\");
            DirectoryInfo movedredinfo = new DirectoryInfo(movedredfolder);
            using (StreamWriter output = new StreamWriter(Path.Combine(movedredfolder, "Master.txt")))
            {
                foreach (FileInfo fi in movedredfolder)
                {
                    output.WriteLine(Path.GetFileName(fi)+"|"+resultingfile);
                }
            }
        }
</code></pre>
