QuickCsv.Net 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package QuickCsv.Net --version 1.0.0                
NuGet\Install-Package QuickCsv.Net -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QuickCsv.Net" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickCsv.Net --version 1.0.0                
#r "nuget: QuickCsv.Net, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install QuickCsv.Net as a Cake Addin
#addin nuget:?package=QuickCsv.Net&version=1.0.0

// Install QuickCsv.Net as a Cake Tool
#tool nuget:?package=QuickCsv.Net&version=1.0.0                

CSV_Helper_Project

csv library for loading/saving csv files relatively quickly and easily This repository serves as a quick csv parser and editor. Supports CSV standard, including multi line cell values. As always with my projects, this library is focused around simplicity and speed. test it for your your own purpose.

Supports:

  • csv standard
  • multi line cells
  • adding/removing columns
  • renaming columns
  • headers and getting cells by column name
  • custom delimiters
  • non std. encodings
  • adding, removing and inserting records

does not support (yet?)

  • automatic cell to type (eg. cell → double) parsing.
  • automatic recognition if there are headers or not
  • automatic encoding identification
  • automatic delimiter type recognition
  • automatic data type proofing (this is a string library, for IO purposes)

sample usage:

Create a Table

// create table class
CSV_Helper_Project.Table allRunResults = new CSV_Helper_Project.Table();
// set headers
allRunResults.SetColumnNames(new[] { "ChestName", "Start Invest", "Average Wagered Coins", "Average Survived Rounds", "Max Balance" });
// add data records
foreach (RunResult result in results)
{
    int index = allRunResults.AppendEmptyRecord();
    allRunResults.SetCell("ChestName", index, result.ChestName);
    allRunResults.SetCell("Start Invest", index, startCash.ToString());
    allRunResults.SetCell("Average Wagered Coins", index, result.WageredCoins.ToString());
    allRunResults.SetCell("Average Survived Rounds", index, result.BettingRounds.ToString());
    allRunResults.SetCell("Max Balance", index, result.MaxBalance.ToString());
}
allRunResults.WriteTableToFile("sample.csv");

read a table

// create table class
CSV_Helper_Project.Table runs = new CSV_Helper_Project.Table();
// load table
runs.LoadFromFile(fi.FullName, hasHeaders: true);
// access table length
RunResult[] results = new RunResult[runs.Length];
// pull data from table into class
for (int i = 0; i < runs.Length; i++)
{
    results[i] = new RunResult() 
    { 
        ChestName = runs.GetCell(i, "ChestName"),
        BettingRounds = double.Parse(runs.GetCell(i, "Average Survived Rounds")),
        WageredCoins = double.Parse(runs.GetCell(i, "Average Wagered Coins")),
        MaxBalance = double.Parse(runs.GetCell(i, "Max Balance"))
    };
}

modify a table

Table table = new Table();

// Set the column names of the table
string[] columnNames = new string[] { "ID", "Name", "Email" };
table.SetColumnNames(columnNames);

// Add a new record to the table
string[] record1 = new string[] { "1", "John Smith", "john@example.com" };
table.AppendRecord(record1);

// Add another record to the table
string[] record2 = new string[] { "2", "Jane Doe", "jane@example.com" };
table.AppendRecord(record2);

// Insert an empty record at the beginning of the table
table.InsertEmptyRecord(0);

// Remove the second record from the table
table.RemoveRecord(1);

// Overwrite the first record with new values
string[] updatedRecord = new string[] { "1", "John Doe", "john.doe@example.com" };
table.OverwriteOrInsertRecord(updatedRecord, "ID");

// Search for a record with the email "jane@example.com" and remove it if it exists
LookupValue lookup = new LookupValue("jane@example.com", "Email");
table.RemoveRecordIfExists(lookup);
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on QuickCsv.Net:

Package Downloads
QuickStatistics.Net

a quick and lightweight library to grab statistics of live data on the fly

PortfolioPerformanceTableHelper

a simple, flexible library for creating CSV entries compatible with Portfolio Performance software. It streamlines transaction management for multiple transaction types and securities.

UnhandledExceptionLogger

this is a basic error logger which logs unhandled exceptions or user defined messages to a specified logfile in csv format and/or to console

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 106 11/13/2024
1.1.0 212 8/8/2023
1.0.6 317 7/31/2023
1.0.5 314 7/19/2023
1.0.4 164 7/19/2023
1.0.3 171 7/19/2023
1.0.2 176 7/19/2023
1.0.1 830 1/25/2023
1.0.0 339 1/9/2023