grimpows
grimpows
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
np and gl with your project :p
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
but for wich other streamReader to use i'm afraid i will not be a good help x')
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
you will see its work
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
and read it with the code above
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
set the file on your drive
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
this work
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
but for a file on the drive
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
almost time i'm doing what the doc say about filestream x')
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
i'm not confident with how stream work
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
mebbe just try download it
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
IBrowserFile ?
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
public class PVSystModel
{
public string E_Grid { get; set; }
}

internal class Program
{
static void Main(string[] args)
{

List<PVSystModel> pVSystModels = new List<PVSystModel>();

var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
HasHeaderRecord = false,
Delimiter = ","

};
using (var reader = new StreamReader(Config.FILE_PATH))
using (var csv = new CsvReader(reader, config))
{
int header_rows_to_skip = 14;
int row_counts = 0;
while (csv.Read())
{
row_counts++;
if (row_counts < header_rows_to_skip) continue;

string E_GridValue = csv.GetField(4);

pVSystModels.Add(new PVSystModel { E_Grid = E_GridValue });
//
// do something like adding it to a list of string
}

}


foreach (PVSystModel pvsysModel in pVSystModels)
{
Console.WriteLine(pvsysModel.E_Grid);
}

Console.ReadKey();

}
}
public class PVSystModel
{
public string E_Grid { get; set; }
}

internal class Program
{
static void Main(string[] args)
{

List<PVSystModel> pVSystModels = new List<PVSystModel>();

var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
HasHeaderRecord = false,
Delimiter = ","

};
using (var reader = new StreamReader(Config.FILE_PATH))
using (var csv = new CsvReader(reader, config))
{
int header_rows_to_skip = 14;
int row_counts = 0;
while (csv.Read())
{
row_counts++;
if (row_counts < header_rows_to_skip) continue;

string E_GridValue = csv.GetField(4);

pVSystModels.Add(new PVSystModel { E_Grid = E_GridValue });
//
// do something like adding it to a list of string
}

}


foreach (PVSystModel pvsysModel in pVSystModels)
{
Console.WriteLine(pvsysModel.E_Grid);
}

Console.ReadKey();

}
}
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
and to match your model i'll modify the code, but its just creating a list on starting then add the value to the list
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
internal class Program
{
static void Main(string[] args)
{

var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
HasHeaderRecord = false,
Delimiter = ","

};
using (var reader = new StreamReader(Config.FILE_PATH)) // replace by the path of your file
using (var csv = new CsvReader(reader, config))
{
int header_rows_to_skip = 14;
int row_counts = 0;
while (csv.Read())
{
row_counts++;
if (row_counts < header_rows_to_skip) continue;

string E_GridValue = csv.GetField(4);
Console.WriteLine(E_GridValue);
// do something like adding it to a list of string
}

}


Console.ReadKey();

}
}
internal class Program
{
static void Main(string[] args)
{

var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
HasHeaderRecord = false,
Delimiter = ","

};
using (var reader = new StreamReader(Config.FILE_PATH)) // replace by the path of your file
using (var csv = new CsvReader(reader, config))
{
int header_rows_to_skip = 14;
int row_counts = 0;
while (csv.Read())
{
row_counts++;
if (row_counts < header_rows_to_skip) continue;

string E_GridValue = csv.GetField(4);
Console.WriteLine(E_GridValue);
// do something like adding it to a list of string
}

}


Console.ReadKey();

}
}
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
its working for me
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
i may try
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
hmm weird, can you send me just few part of your csv ?
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
you can just do a Console.WriteLine(csv.GetField(4)); to see different value for the 5th field (start at 0 for the parameters of GetField = 1st value)
47 replies
CC#
Created by RiamuYui on 8/11/2023 in #help
❔ Trying to map CSVHelper to weirdly formed CSV
yep its coma delimiter
47 replies