Esempio n. 1
0
        private static async Task CopyCSVFileToStringWriterAsynchronously()
        {
            #region CopyCSVFileToStringWriterAsynchronously

            using (var stringWriter = new StringWriter())
            {
                using (var streamReader = new StreamReader("PlanetaryData.csv"))
                    using (var reader = new CsvReader(streamReader))
                        using (var writer = new CsvWriter(stringWriter))
                        {
                            writer.ValueSeparator = '\t';
                            writer.ValueDelimiter = '\'';

                            await reader.CopyToAsync(writer);
                        }

                Console.WriteLine(stringWriter);
            }

            #endregion
        }