Menu

csvwriter_features

HuDeanY

CsvWriter features

  • Constructor parameters are the same as the ones for the CsvReader.
  • setAlwaysQuote(boolean alwaysQuote)
    If set, then all data values (strings and integers etc.) surrounded by the stringquote. Even if it is not necessary.

  • setQuoteAllStrings(boolean quoteAllStrings)
    If set, then all data strings surrounded by the stringquote. Even if it is not necessary. Integers and other values are not surrounded by the stringquote.

  • setStringQuoteEscapeCharacter(char stringQuoteEscapeCharacter)
    By default the same character as set for string quotes is used for escaped string quotes inside quoted strings. This means it should be doubled like in ANSI-SQL. If this is set explicitly it is used for escaping the string quote character. Mostly then set to '\'.

  • writeValues(Object... values)
    Write data as given by an array.

  • writeValues(List<? extends Object> values)
    Write data as given by a list of objects.

  • writeAll(List<List<? extends="" Object="">> valueLines)
    Write all data as given by a list of list of objects.

  • getWrittenLines()
    Get number of written lines until now.

  • getReadChracters()
    Get number of read characters until now.

  • getCsvLine(char separator, Character stringQuote, List<? extends Object> values)
    Static method to format a single Csv string line.

  • getCsvLine(char separator, Character stringQuote, Object... values)
    Static method to format a single Csv string line.

Don't forget to use flush() if you want to see the written results without closing the outputstream now.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.