Class CVSParser

    • Constructor Detail

      • CVSParser

        public CVSParser​(Path file)
                  throws IOException
        Constructor.
        Parameters:
        file - file to read
        Throws:
        IOException - if an error occurs while reading file
      • CVSParser

        public CVSParser​(Path file,
                         char separator)
                  throws IOException
        Constructor.
        Parameters:
        file - file to read
        separator - separator char
        Throws:
        IOException - if an error occurs while reading file
      • CVSParser

        public CVSParser​(List<String> lines)
        Constructor.
        Parameters:
        lines - lines to parse
      • CVSParser

        public CVSParser​(List<String> lines,
                         char separator)
        Constructor.
        Parameters:
        lines - lines to parse
        separator - separator char
    • Method Detail

      • contains

        public boolean contains​(String fieldName)
        Test if the file contains a field
        Parameters:
        fieldName - field name
        Returns:
        true if the field exists in the file
      • fields

        public List<String> fields()
        Get the list of the fields.
        Returns:
        a list with the fields of the file
      • parse

        public CSVLineParser parse​(String line)
        Parse a line.
        Parameters:
        line - line to parse
        Returns:
        a CSVLineParser object