-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Core.IO.DelimitedData
public static class CreateInheritance System.Object → Create
Creates a list of columns from string names.
public static System.Collections.Generic.List<DiGi.Core.IO.Table.Classes.Column>? Columns(this System.Collections.Generic.IEnumerable<string>? names);names System.Collections.Generic.IEnumerable<System.String>
The collection of column names to convert.
System.Collections.Generic.List<Column>
A list of Column objects, or null if the input is null.
Creates a Table from a delimited file using a separator character.
public static DiGi.Core.IO.Table.Classes.Table? Table(string? path, char separator, int columnIndex=0, int rowIndex=1);path System.String
The path to the delimited file.
separator System.Char
The character used as a separator in the delimited file.
columnIndex System.Int32
The index of the column to start from. Defaults to 0.
rowIndex System.Int32
The index of the row to start from. Defaults to 1.
Table
A Table object if successful; otherwise, null.
Creates a Table from a delimited file using a DelimitedDataSeparator enum value.
public static DiGi.Core.IO.Table.Classes.Table? Table(string? path, DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, int columnIndex=0, int rowIndex=1);path System.String
The path to the delimited file.
delimitedDataSeparator DelimitedDataSeparator
The separator used in the delimited file.
columnIndex System.Int32
The index of the column to start from. Defaults to 0.
rowIndex System.Int32
The index of the row to start from. Defaults to 1.
Table
A Table object if successful; otherwise, null.
Converts DelimitedDataReader to Table
public static DiGi.Core.IO.Table.Classes.Table? Table(this DiGi.Core.IO.DelimitedData.Interfaces.IDelimitedDataReader? delimitedDataReader, int columnIndex=0, int rowIndex=1);delimitedDataReader IDelimitedDataReader
DelimitedDataReader
columnIndex System.Int32
Header index (column names). If data has no header then set to -1
rowIndex System.Int32
Row Index where data starts
public static class ModifyInheritance System.Object → Modify
Appends a table's data to a delimited file.
public static bool Append(string? path, DiGi.Core.IO.Table.Classes.Table? table, char separator, System.Func<object?,string?>? func=null);path System.String
The path to the delimited file.
table Table
The table containing the data to append.
separator System.Char
The character used as a separator in the delimited file.
func System.Func<System.Object,System.String>
An optional function to convert objects to strings.
System.Boolean
True if the operation was successful; otherwise, false.
Reads delimited data from a reader into a table.
public static bool Read(this DiGi.Core.IO.Table.Classes.Table? table, DiGi.Core.IO.DelimitedData.Interfaces.IDelimitedDataReader? delimitedDataReader, int columnIndex=0, int rowIndex=1);table Table
The table to read the data into.
delimitedDataReader IDelimitedDataReader
The reader used to read the delimited data.
columnIndex System.Int32
The index of the column to start reading from. Defaults to 0.
rowIndex System.Int32
The index of the row to start reading from. Defaults to 1.
System.Boolean
True if the data was read successfully; otherwise, false.
Reads delimited data from a file using a separator character into a table.
public static bool Read(this DiGi.Core.IO.Table.Classes.Table? table, string? path, char separator, int columnIndex=0, int rowIndex=1);table Table
The table to read the data into.
path System.String
The path to the file containing the delimited data.
separator System.Char
The character used as a separator in the delimited data file.
columnIndex System.Int32
The index of the column to start reading from. Defaults to 0.
rowIndex System.Int32
The index of the row to start reading from. Defaults to 1.
System.Boolean
True if the data was read successfully; otherwise, false.
Reads delimited data from a file using a DelimitedDataSeparator enum into a table.
public static bool Read(this DiGi.Core.IO.Table.Classes.Table? table, string? path, DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, int columnIndex=0, int rowIndex=1);table Table
The table to read the data into.
path System.String
The path to the file containing the delimited data.
delimitedDataSeparator DelimitedDataSeparator
The separator used in the delimited data file.
columnIndex System.Int32
The index of the column to start reading from. Defaults to 0.
rowIndex System.Int32
The index of the row to start reading from. Defaults to 1.
System.Boolean
True if the data was read successfully; otherwise, false.
Writes a table to a delimited data writer.
public static bool Write(this DiGi.Core.IO.Table.Classes.Table? table, DiGi.Core.IO.DelimitedData.Interfaces.IDelimitedDataWriter? delimitedDataWriter, System.Func<object?,string?>? func=null);table Table
The table to write.
delimitedDataWriter IDelimitedDataWriter
The delimited data writer to use.
func System.Func<System.Object,System.String>
An optional function to convert objects to strings.
System.Boolean
True if the write operation was successful; otherwise, false.
Writes a table to a delimited file using a separator character.
public static bool Write(this DiGi.Core.IO.Table.Classes.Table? table, string? path, char separator, System.Func<object?,string?>? func=null);table Table
The table to write.
path System.String
The path where the file will be written.
separator System.Char
The character to use as a separator.
func System.Func<System.Object,System.String>
An optional function to convert objects to strings.
System.Boolean
True if the write operation was successful; otherwise, false.
Writes a table to a delimited file using a DelimitedDataSeparator enum.
public static bool Write(this DiGi.Core.IO.Table.Classes.Table? table, string? path, DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, System.Func<object?,string?>? func=null);table Table
The table to write.
path System.String
The path where the file will be written.
delimitedDataSeparator DelimitedDataSeparator
The separator to use for the delimited data.
func System.Func<System.Object,System.String>
An optional function to convert objects to strings.
System.Boolean
True if the write operation was successful; otherwise, false.
public static class QueryInheritance System.Object → Query
Gets the character value of a DelimitedDataSeparator enum member.
public static char Separator(this DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator);delimitedDataSeparator DelimitedDataSeparator
The delimited data separator to get the character value for.
System.Char
The character representation of the specified delimiter.
Joins a collection of values into a delimited string.
public static string? Text(this System.Collections.Generic.IEnumerable<string?>? values, char separator);values System.Collections.Generic.IEnumerable<System.String>
The collection of strings to join.
separator System.Char
The character used as the delimiter between strings.
System.String
A string containing the joined values, or null if the input is null.
Parses a delimited line into individual values.
public static System.Collections.Generic.List<string>? Values(this string? line, char separator, System.Func<string>? nextLine=null);line System.String
The string to be parsed.
separator System.Char
The character used as the delimiter.
nextLine System.Func<System.String>
An optional function to retrieve the next line if needed for multi-line parsing.
System.Collections.Generic.List<System.String>
A list of strings containing the parsed values, or null if the input line is null.