Skip to content

joaoduarte19/csvparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSV Parser

CSV Parser for Delphi

Samples

uses
  System.SysUtils,
  CSVParser.Reader;

var
  LCSVReader: TCSVReader;
begin
  try
    LCSVReader := TCSVReader.Create;
    try
      LCSVReader.LoadFromFile('path_to_csv_file.csv');
      while not LCSVReader.Eof do
      try
        // Get field by index
        Writeln(LCSVReader.Field[0]);
        // Get field by name
        Writeln(LCSVReader.FieldByName['field_name']);
      finally
        LCSVReader.Next;
      end;
    finally
      LCSVReader.Free;
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Releases

No releases published

Packages

No packages published

Languages