Questions tagged [linqtocsv]

LINQtoCSV - popular, easy to use library to read and write CSV files.

This library makes it easy to use CSV files with LINQ queries. Its features include:

  • Follows the most common rules for CSV files. Correctly handles data fields that contain commas and line breaks.
  • In addition to comma, most delimiting characters can be used, including tab for tab delimited fields.
  • Can be used with an IEnumarable of an anonymous class - which is often returned by a LINQ query.
  • Supports deferred reading.
  • Supports processing files with international date and number formats.
  • Supports different character encodings if you need them.
  • Recognizes a wide variety of date and number formats when reading files.
  • Provides fine control of date and number formats when writing files.
  • Robust error handling, allowing you to quickly find and fix problems in large input files.
25 questions
0
votes
1 answer

C# lock not working when log csv to appendblob

I have an application where in i log to azure appendblob as csv. I am using LinqToCsv->CsvContext to write as csv. Each time i write the log, i check if the appendblob has got any length, if it is zero then i write the header to the csv. Every thing…
Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156
0
votes
3 answers

LinqToCSV format column as Text

I'm using LinqToCSV to output a List to CSV. Snippet of sample code is as follows: class Person { [CsvColumn(Name = "Name", FieldIndex = 1)] public string UserName { get; set; } [CsvColumn(Name = "Address 1", FieldIndex = 2)] public…
timbo
  • 63
  • 6
0
votes
1 answer

LinqToCsv - Writing single objects to the file

I am using the LinqToCsv library for creating a comma delimited file and ran into a problem. I read the article about it here: http://www.codeproject.com/Articles/25133/LINQ-to-CSV-library In my case my class design is something like this: class…
Bohn
  • 26,091
  • 61
  • 167
  • 254
0
votes
2 answers

Convert IEnumerable string array to datatable

I have a csv file delimited with pipe(|). I am reading it using the following line of code: IEnumerable lineFields = File.ReadAllLines(FilePath).Select(line => line.Split('|')); Now, I need to bind this to a GridView. So I am creating a…
Ankith
  • 145
  • 2
  • 12
0
votes
1 answer

How do i save the output of LinqToCSV on Client Side in ASP.NET

I am currently able to save a List to a CSV file on the server as in code below. However i want the ASP.NET application to prompt the user with a File Save Dialog box and save it in his client system. So i have this code in the 'Export to CSV'…
Chakra
  • 2,525
  • 8
  • 43
  • 82
0
votes
0 answers

Trying to use LinqToCSV to parse non standard CSV file

Hi I have the following CSV file: COMMADDMMYY HHMM HEAD LINE VAT TLR SCHEDRECON HEAD, TEST, JSHO, 5010011090036, B05460003086, 250501, 260501, 0000, Z929901, , , , , , , , , , , , , , , , LINE, 1, , , 14, 5010012143560, , , , , , , LINE, 9, , , 35,…
Neil Hosey
  • 465
  • 6
  • 23
0
votes
1 answer

The file is being used by another process, SaveFileDialog

I am using LinqToCSV to export list of values in C#, and it works fine when I use only two lines as LINQtoCSV.CsvContext CSVContext = new CsvContext(); CSVContext.Write(bullishRowList, "C://FileName.CSV"); But I want to use…
Lali
  • 2,816
  • 4
  • 30
  • 47
-1
votes
1 answer

Read Single Value from CSV (LINQtoCSV)

I want to read a single Value from a CSV File (e.g. Line 3, Column 2). I'm using the LINQtoCSV NuGet Paket (https://www.codeproject.com/Articles/25133/LINQ-to-CSV-library#_articleTop) class Product { [CsvColumn(Name = "Steckplatz", FieldIndex =…
-1
votes
1 answer

How to save CSV logs in Azure AppendBlob

How to store csv logs to Azure AppendBlob without affecting any perfomance? My code to write csv to memory stream: public static byte[] WriteCsvWithHeaderToMemory(IEnumerable records) where T : class { var outputFileDescription = new…
Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156
-2
votes
1 answer

Writting to CSV file using LINQtoCSV, puts CR LF at the end of the file

I'm writting wifi data (ID and password) into a CSV file using the LINQtoCSV NuGet and I'm getting at the end of the line Carriage return (red ractangle on the picture). Could the .TrimEnd('\r', '\n') method help me in some way? My code: var…
George
  • 124
  • 1
  • 12
1
2