I have a CSV file with a listing of varied data(datetime, decimal). Sample line from CSV:
Date,Open,High,Low,Close,Volume,Adj Close //I need to skip this first line as well
2012-11-01,77.60,78.12,77.37,78.05,186200,78.05
I have a list of objects created that I want to read each of the lines into. The constructor for the objects is below, each of the fields from each CSV line is used and assigned here.
public DailyValues(DateTime date, decimal open, decimal high, decimal low,
decimal close, decimal volume, decimal adjClose)
: this()
{
Date = date;
Open = open;
High = high;
Low = low;
Close = close;
Volume = volume;
AdjClose = adjClose;
}
List<DailyValues> values = new List<DailyValues>();
Is there an easy way to read each line of the CSV into my list values
and appropriately assign each attribute (i.e. date, open, high)?