Table of Contents

Class CsvUtil

Namespace
Hi.Common.CsvUtils
Assembly
HiGeom.dll

Provides utility methods for working with CSV (Comma-Separated Values) data.

public static class CsvUtil
Inheritance
CsvUtil
Inherited Members

Methods

GetCsvLines(IEnumerable<IGetCsvDictionary>, List<string>)

Get Comma-seperated Csv lines. The title line is at the last return.

public static IEnumerable<string> GetCsvLines(this IEnumerable<IGetCsvDictionary> rows, List<string> prefixTitleList = null)

Parameters

rows IEnumerable<IGetCsvDictionary>

rows

prefixTitleList List<string>

Custom title order at the leading columns. If no custom order needed, keep the parameter null.

Returns

IEnumerable<string>

CSV lines.

GetCsvLines(IEnumerable<Dictionary<string, string>>, List<string>)

Get Comma-seperated Csv lines. The title line is at the last return.

public static IEnumerable<string> GetCsvLines(IEnumerable<Dictionary<string, string>> rows, List<string> prefixTitleList = null)

Parameters

rows IEnumerable<Dictionary<string, string>>

rows

prefixTitleList List<string>

Custom title order at the leading columns. If no custom order needed, keep the parameter null.

Returns

IEnumerable<string>

CSV lines.

GetCsvRowText(object[])

Converts an array of objects to a CSV row text.

public static string GetCsvRowText(object[] objs)

Parameters

objs object[]

Array of objects to be converted to CSV format.

Returns

string

A comma-separated string representing the objects.