123456789101112131415161718192021222324 |
- namespace Universal;
- 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;
- }
- }
|