0

Below is a method I call to try and read in a vcf file line by line into an array of strings.

    internal static void splitUpFile(String fileLocation)
    {
        string[] file = System.IO.File.ReadAllLines(fileLocation);


        System.Console.WriteLine("Contents of contacts.vcf =:");
        foreach (string line in file)
        {
            Console.WriteLine("\t" + line);
        }


        Console.WriteLine("Press any key to exit.");
        System.Console.Read();

    }

Now I want to split the array into three other vcf files, which are created dynamically and placed in the same directory as the one that has been read in? Is this possible?

Peter Djeneralovic
  • 507
  • 1
  • 7
  • 15

1 Answers1

0

To appear and keep open console use

Console.ReadLine();

at the last line.

To create other vcf file using the step as below:

1. create a directory
2. create a file with .vcf extension in that directory
3. write data to and read data from that created file kept in the specified directory
Rashedul.Rubel
  • 3,446
  • 25
  • 36