Ads API .NET library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Google.Api.Ads.Common.Util.CsvFile Class Reference

Wraps the functionalities to read and write from a CSV file. More...

Public Member Functions

 CsvFile ()
 Public constructor. More...
 
void Read (string fileName, bool hasHeaders)
 Reads the contents of the CSV file into memory. More...
 
void ReadFromString (string contents, bool hasHeaders)
 Reads the contents of the CSV string into memory. More...
 
void Write (string fileName)
 Writes the contents of the CsvFile object into a file. More...
 

Properties

List< string > Headers [get]
 List of CSV file headers. More...
 
List< string[]> Records [get]
 List of records in the CSV file. More...
 

Detailed Description

Wraps the functionalities to read and write from a CSV file.

Constructor & Destructor Documentation

Google.Api.Ads.Common.Util.CsvFile.CsvFile ( )
inline

Public constructor.

Member Function Documentation

void Google.Api.Ads.Common.Util.CsvFile.Read ( string  fileName,
bool  hasHeaders 
)
inline

Reads the contents of the CSV file into memory.

Parameters
fileNameFull path to the csv file.
hasHeadersTrue, if the first line of the csv file is a header.
void Google.Api.Ads.Common.Util.CsvFile.ReadFromString ( string  contents,
bool  hasHeaders 
)
inline

Reads the contents of the CSV string into memory.

Parameters
contentsText to be parsed as csv file contents.
hasHeadersTrue, if the first line of the csv file contents is a header.
void Google.Api.Ads.Common.Util.CsvFile.Write ( string  fileName)
inline

Writes the contents of the CsvFile object into a file.

Parameters
fileNameThe full path of the file to which the contents are to be written.

The file will have headers only if Headers are set for this object.

Property Documentation

List<string> Google.Api.Ads.Common.Util.CsvFile.Headers
get

List of CSV file headers.

List<string[]> Google.Api.Ads.Common.Util.CsvFile.Records
get

List of records in the CSV file.


The documentation for this class was generated from the following file: