TsadriuUtilities.Csv
1.4.2
See the version list below for details.
dotnet add package TsadriuUtilities.Csv --version 1.4.2
NuGet\Install-Package TsadriuUtilities.Csv -Version 1.4.2
<PackageReference Include="TsadriuUtilities.Csv" Version="1.4.2" />
paket add TsadriuUtilities.Csv --version 1.4.2
#r "nuget: TsadriuUtilities.Csv, 1.4.2"
// Install TsadriuUtilities.Csv as a Cake Addin #addin nuget:?package=TsadriuUtilities.Csv&version=1.4.2 // Install TsadriuUtilities.Csv as a Cake Tool #tool nuget:?package=TsadriuUtilities.Csv&version=1.4.2
TsadriuUtilities.Csv
A small package that parses a CSV file.
TsadriuUtilities.Csv is a library that helps on dealing with CSV files, to make it easier and save a little bit of time.
> Features <
CsvTable:
→ To create a new instance, use ICsvTable table = new CsvTable(string[] csvLines, string delimiter = ";") + 5 overload;
- CultureInfo CultureInfo { get; set; }
- Gets or sets the culture of this table. Setting this property will apply the culture on all elements of the ColumnList.
- string Delimiter { get; set; }
- Gets or sets the delimiter used on the csv file.
- List<ICsvColumn> ColumnList { get; set; }
- Gets or sets the list of ICsvColumn of the current ICsvTable.
- AddColumn(string columnName, int index = -1) + 1 overload:
- Adds a new column to the ColumnList.
- GetColumn(string columnName, StringComparison comparison):
- Returns the column based on the name. If the column does not exist, it returns a new column with the name of UNDEFINED.
- Supports csvTable[string columnName] variant.
- GetColumnIndex(string columName, CsvSearchType searchType, StringComparison comparison):
- Returns the index of the column.
- Supports csvTable[string columnName, CsvSearchType seachType] variant.
- ICsvColumn GetColumn(string columnName, StringComparison comparison):
- Checks if the columnName exists in the ColumnList, returning the first instance found. If it doesn't exist, it return a new CsvColumn with the name UNDEFINED.
- MoveColumn(int oldIndex, int newIndex) + 1 overload:
- Moves the position of this column with another column.
- RemoveColumn(int[] columnIndex) + 1 overload:
- Removes a column from the ColumnList.
- List<string> ToList(bool includeHeader):
- Converts the ICsvTable into a List<string>.
- string[] ToArray(bool includeHeader):
- Converts the ICsvTable into an array of string.
CsvColumn:
→ _To create a new instance, use ICsvColumn column = new CsvColumn() + 3 overload;
- string Name { get; set; }
- Gets or sets the column name.
- CultureInfo CultureInfo { get; set; }
- Gets or sets the culture info.
- bool ContainsEmptyRows { get; }
- Gets a value indicating whether this column contains any empty rows or not.
- List<string> RowList { get; set; }
- Gets or sets the row list.
- AddRow(string row) + 1 overload:
- Adds a row.
- GetRow(int index):
- Returns the row corresponding to the index. If the index is out of bounds, it returns a string.Empty.
- Supports csvColumn[int index] variant.
- GetRowEqual(StringComparison comparison, string value)
- Returns the first row that contains the value.
- GetRowOrEqual(StringComparison comparison, params string[] values)
- Returns the first row that contains one of the values.
- GetRowAndContains(StringComparison comparison, params string[] values)
- Returns the first row that contains all of the values.
- GetRowOrContains(StringComparison comparison, params string[] values)
- Returns the first row that contains one of the values.
- NormalizeNumbers(CultureInfo? culture):
- Normalizes the numbers of the RowList by using the CultureInfo.
- ChangeDateFormat(string oldDateFormat, string newDateFormat):
- Parses the RowList with the oldDateFormat to a DateTime and converts it back to a string using the newDateFormat.
CsvHelper:
- ReadMultipleHeaderCsv(string[] csvLines, string delimiter, int[] headerPosition) + 1 overload:
- Helps on reading a csv that has multiple headers.
- ToList(List<ICsvTable> tableList):
- Converts a List of ICsvTable into a csv.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
-
net6.0
- TsadriuUtilities (>= 1.12.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.7.3 | 522 | 6/15/2023 |
1.7.2 | 200 | 5/22/2023 |
1.7.1 | 246 | 4/17/2023 |
1.7.0 | 243 | 2/28/2023 |
1.6.1 | 412 | 2/21/2023 |
1.6.0 | 254 | 2/17/2023 |
1.5.4 | 238 | 2/14/2023 |
1.5.3 | 254 | 2/14/2023 |
1.5.2 | 250 | 2/14/2023 |
1.5.1 | 246 | 2/14/2023 |
1.5.0 | 259 | 2/14/2023 |
1.4.4 | 262 | 2/13/2023 |
1.4.3 | 265 | 2/13/2023 |
1.4.2 | 231 | 2/13/2023 |
1.4.1 | 241 | 2/13/2023 |
1.4.0 | 263 | 2/13/2023 |
1.3.0 | 283 | 2/10/2023 |
1.2.0 | 280 | 2/7/2023 |
1.1.1 | 323 | 1/25/2023 |
1.1.0 | 290 | 1/25/2023 |
1.0.0 | 284 | 1/24/2023 |
CsvTable:
- Implemented method GetColumnIndex(string columnName, CsvSearchType searchType);
- Implemented indexer [string columnName, CsvSearchType searchType] { get; }.