Class CSVConfigGuesser

  • public class CSVConfigGuesser
    extends Object
    Tries to guess a config based on an InputStream.
    • Field Detail

      • config

        protected CSVConfig config
        The found config
    • Constructor Detail

      • CSVConfigGuesser

        public CSVConfigGuesser()
      • CSVConfigGuesser

        public CSVConfigGuesser​(InputStream in)
        in - the inputstream to guess from
    • Method Detail

      • setInputStream

        public void setInputStream​(InputStream in)
      • getInputStream

        protected InputStream getInputStream()
        Allow override.
        the inputstream that was set.
      • guess

        public CSVConfig guess()
        Guess the config based on the first 10 (or less when less available) records of a CSV file.
        the guessed config.
      • analyseLines

        protected void analyseLines​(String[] lines)
      • guessFixedWidth

        protected void guessFixedWidth​(String[] lines)
        Guess if this file is fixedwidth. Just basing the fact on all lines being of the same length
      • guessFieldSeparator

        protected void guessFieldSeparator​(String[] lines)
      • guessFixedWidthSeparator

        protected void guessFixedWidthSeparator​(String[] lines)
      • hasFieldHeader

        public boolean hasFieldHeader()
        if the field uses a field header. Defaults to false.
      • setHasFieldHeader

        public void setHasFieldHeader​(boolean hasFieldHeader)
        Specify if the CSV file has a field header
        hasFieldHeader - true or false