Im using console application in console window i see each line twice why?
<pre><code>using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int y;
            FileInfo fi;
            string[] newDest_files;
            string[] lines = global::EachFileDirectory.MyResource.video_formats.Split    (new Char[] {'\r','\n'});
            foreach (string line in lines)
            {
                newDest_files = Directory.GetFiles(Environment.CurrentDirectory,         line); //strFilter );
                for (y = 0; y &lt; newDest_files.Length; y++)
                {
                    fi = new FileInfo(newDest_files[y]);
                    string newFolder = Path.Combine(fi.DirectoryName, fi.Name                 + "_Directory");
                    if (!Directory.Exists(newFolder))
                        Directory.CreateDirectory(newFolder);
                    Console.WriteLine("processed: " + line.Length + " files");
                    File.Move(fi.FullName, Path.Combine(newFolder, fi.Name));
                }
                if (newDest_files.Length == 0)
                {
                    Console.WriteLine(line + "No files found in the current directory      of format: ");
             }
        }
        Console.WriteLine("\n Done! Press any key to exit...");
        Console.ReadKey();         
    }
}
</code></pre>

<p>}</p>

<p>The problem is when i have added the line: string[] lines = global::EachFileDirectory.MyResource.video_formats.Split(new Char[] {'\r','\n'});</p>

<p>Since then i see in the console window all the lines double for example:</p>

<p>*.264 No files found in the current directory of format: 
No files found in the current directory of format: 
*.mov No files found in the current directory of format: 
No files found in the current directory of format: </p>

<p>What i need to see in the console window is:</p>

<p>*.264 No files found in the current directory of format: 
*.mov No files found in the current directory of format: </p>

<p>And so on but since i have the line: string[] lines = global::EachFileDirectory.MyResource.video_formats.Split(new Char[] {'\r','\n'});
And also the line in the end of the code: Console.WriteLine(line + "No files found in the current directory of format: ");</p>

<p>I see No files found in the current directory of format:  also in between each line.</p>

<p>How can i fix it ?</p>

<p>On the reference of the project i added a text file wich contain many video formats extentions in this way:</p>

<p>*.264
*.mov
*.avi</p>

<p>and so on.....</p>

<p>The problem is that the text: No files found in the current directory of format: 
Appears near each format and also between two formats and i want ti to be in the console window only near each format !</p>

<p>Thanks a lot.</p>
