Hello Community,
Does Streamreader class work in Dataminer ?
Does CSVReader ( not built-in but a 3rd party library) work in Dataminer?
Can both be used as represented in the snippet (part of a larger C# code) below to read the content of a .csv file in Dataminer?
using (var streamReader = new StreamReader(@"C:\folder\file.csv"))
{
using (var csvreader = new csvReader(streamReader, CultureInfo.InvriantCulture()
{
var records = csvReader.GetRecords<CoordinateHeight>().ToList();
}
Hi Samson,
Yes, (almost) all C# code works in automation scripts and connectors within DataMiner. StreamReader certainly works (using System.IO). Your CSVReader 3rd party library will also work if it's targeting .NET Framework.
The CSVReader library probably also requires a DLL reference as explained here. NuGet packages are also supported, but fot that I would recommend to use DIS, which is now free of charge.
More general information about running C# code in an automation script can be found here.
May I ask what the reason is for this question? Do you have a specific problem we can help you with?
Thanks so much for this timely piece Tom. Would check the other URLs and revert.