Package org.supercsv.io

Examples of org.supercsv.io.CsvListReader


      String sep = p.getSeparatorChar();
      String quo = p.getQuotingChar();
      if (sep != null && sep.length() == 1) prefs.setDelimiterChar(sep.charAt(0));
      if (quo != null && quo.length() == 1) prefs.setQuoteChar(quo.charAt(0));
     
      ICsvListReader csv = new CsvListReader(new InputStreamReader(new ByteArrayInputStream(this.data),p.getFileEncoding()),prefs);
      List<String> line = null;
      while ((line = csv.read()) != null)
      {
        // Der CSV-Reader verwendet das List-Objekt leider immer
        // wieder (wird fuer die naechste Zeile geleert und neu
        // befuellt. Daher koennen wir sie nicht so einfach hier
        // reinpacken sondern muessen die Werte rauskopieren
View Full Code Here


  protected CsvSource(Reader in, boolean hasHeader) {
    this(in, CsvPreference.STANDARD_PREFERENCE, hasHeader);
  }

  protected CsvSource(Reader in, CsvPreference preference, boolean withHeader) {
    csvListReader = new CsvListReader(in, preference);
    String[] header = null;
    if (withHeader) {
      try {
        header = csvListReader.getHeader(true);
      } catch (IOException e) {
View Full Code Here

        }
    }

    public static List<String> parseHintedHandoffEnabledDCs(final String dcNames) throws IOException
    {
        try (final CsvListReader csvListReader = new CsvListReader(new StringReader(dcNames), STANDARD_SURROUNDING_SPACES_NEED_QUOTES))
        {
          return csvListReader.read();
        }
    }
View Full Code Here

        }
    }

    public static List<String> parseHintedHandoffEnabledDCs(final String dcNames) throws IOException
    {
        final CsvListReader csvListReader = new CsvListReader(new StringReader(dcNames), STANDARD_SURROUNDING_SPACES_NEED_QUOTES);
        return csvListReader.read();
    }
View Full Code Here

        }
    }

    public static List<String> parseHintedHandoffEnabledDCs(final String dcNames) throws IOException
    {
        final CsvListReader csvListReader = new CsvListReader(new StringReader(dcNames), STANDARD_SURROUNDING_SPACES_NEED_QUOTES);
        return csvListReader.read();
    }
View Full Code Here

        }
    }

    public static List<String> parseHintedHandoffEnabledDCs(final String dcNames) throws IOException
    {
        final CsvListReader csvListReader = new CsvListReader(new StringReader(dcNames), STANDARD_SURROUNDING_SPACES_NEED_QUOTES);
        return csvListReader.read();
    }
View Full Code Here

    public Iterator() {
      try {
        FileReader core = new FileReader(source);
        //Get to the first record-start in the segment
        core.skip(segStart);
        base = new CsvListReader(core, CsvPreference.STANDARD_PREFERENCE);

        //Get to the first full record in the segment
        if (segStart == 0) {
          for (long i=skip; i>0; i--) {base.read();}         
        } else {
View Full Code Here

    {
      List<String> values = cache.get(key);
      if (values == null)
      {
        String sValue = originalChain.getValue(key, keyMetadata.withDataType(String.class));
        try (CsvListReader reader = new CsvListReader(new StringReader(sValue), csvFormat))
        {
          values = reader.read();
          if (values == null)
            values = Collections.emptyList();
         
          cache.put(key, values);
        }
View Full Code Here

        try {
            if (CSVLoader.standin) {
                tokenizer = new Tokenizer(new BufferedReader(new InputStreamReader(System.in)), csvPreference,
                        config.strictquotes, config.escape, config.columnsizelimit,
                        config.skip);
                listReader = new CsvListReader(tokenizer, csvPreference);
            } else {
                tokenizer = new Tokenizer(new FileReader(config.file), csvPreference,
                        config.strictquotes, config.escape, config.columnsizelimit,
                        config.skip);
                listReader = new CsvListReader(tokenizer, csvPreference);
            }
        } catch (FileNotFoundException e) {
            m_log.error("CSV file '" + config.file + "' could not be found.");
            System.exit(-1);
        }
View Full Code Here

        }
    }

    public static List<String> parseHintedHandoffEnabledDCs(final String dcNames) throws IOException
    {
        final CsvListReader csvListReader = new CsvListReader(new StringReader(dcNames), STANDARD_SURROUNDING_SPACES_NEED_QUOTES);
        return csvListReader.read();
    }
View Full Code Here

TOP

Related Classes of org.supercsv.io.CsvListReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.