using System.IO;

namespace UniversalNetFrame451;

public class BasicCSVReader
{
    public static bool ReadCSV(string filePath, out List<string[]> fields)
    {
        fields = [];
        if (!File.Exists(filePath))
            return false;
        try
        {
            using var reader = new StreamReader(filePath);
            string line;
            while ((line = reader.ReadLine()) is not null)
                fields.Add(line.Split(','));
        }
        catch
        {
            return false;
        }

        return true;
    }
}