Class CsvTools
Assembly: TowseyLibrary.dll
[Obsolete]
public static class CsvTools
Methods
|
Improve this Doc
View Source
this method is called by the previous method when reading in a CSV file.
It is used only to get csv data into a column format so that the data type for each field can be determined.
Declaration
public static List<string[]> ConvertCSVRowsToListOfStringArrays(string[] csvRows, int rowStart, int rowEnd)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static void DataTable2CSV(DataTable dt, string strFilePath)
Parameters
|
Improve this Doc
View Source
Declaration
public static object[] MakeItemArray(string[] fields, Type[] types)
Parameters
Type |
Name |
Description |
String[] |
fields |
|
Type[] |
types |
|
Returns
|
Improve this Doc
View Source
Returns the requested column of data from a CSV file and also returns the column header.
Declaration
public static double[] ReadColumnOfCsvFile(string fileName, int colNumber, out string header)
Parameters
Returns
|
Improve this Doc
View Source
returns a list of the column values in a csv file plus the column headings
ASSUMED to be doubles
returns as lists of type double
TODO Anthony to use the new U-BEAUT csv file reader.
Declaration
public static Tuple<List<string>, List<double[]>> ReadCSVFile(string csvFileName)
Parameters
Type |
Name |
Description |
String |
csvFileName |
|
Returns
|
Improve this Doc
View Source
returns a Dictionary of the column values in a csv file with column headings as keys
ASSUMED to be doubles
TODO Anthony to use the new U-BEAUT csv file reader.
Declaration
public static Dictionary<string, double[]> ReadCSVFile2Dictionary(string csvFileName)
Parameters
Type |
Name |
Description |
String |
csvFileName |
|
Returns
|
Improve this Doc
View Source
Declaration
public static double[, ] ReadCSVFile2Matrix(string csvFileName)
Parameters
Type |
Name |
Description |
String |
csvFileName |
|
Returns
|
Improve this Doc
View Source
Declaration
public static List<double[]> ReadCSVFileOfDoubles(string csvFileName, bool skipHeader, bool skipFirstColumn)
Parameters
Returns
|
Improve this Doc
View Source
reads a CSV file into a Datatable and deduces the data type in each column.
Declaration
public static DataTable ReadCSVToTable(string filePath, bool isFirstRowHeader)
Parameters
Returns
|
Improve this Doc
View Source
loads a data table with data in given csv file.
If the column types are not given then default to string
CALLED ONLY BY KIWI RECOGNIZER TO READ GROUND TRUTH TABLE.
Declaration
public static DataTable ReadCSVToTable(string filePath, bool isFirstRowHeader, Type[] types)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static void WriteDictionaryOfDoubles2CSV(Dictionary<string, double[]> dictionary, FileInfo opFile)
Parameters