-
I'm importing csv files with different formats, and also not the same columns every time.. Any better way to do this? (I guess so...) public SystemImportClassMap()
{
Map(m => m.LineNumber).Convert(record => record.Row.Parser.Row);
Map(m => m.CostPrice).Convert(record => decimal.Parse(record.Row["CostPrice"].ToString().Replace('.', ','))).Name("CostPrice");
Map(m => m.SalesPrice).Convert(record => decimal.Parse(record.Row["SalesPrice"].ToString().Replace('.', ','))).Name("SalesPrice");
Map(m => m.Memo).Name("Memo");
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That may be a little slow. I would suggest finding what culture the CSV is in, then setting that. There could be other things in the file that are different for that culture also. Cultures that use |
Beta Was this translation helpful? Give feedback.
That may be a little slow. I would suggest finding what culture the CSV is in, then setting that. There could be other things in the file that are different for that culture also. Cultures that use
,
for decimal may also use.
for thousands separator.