Questions tagged [univocity]

univocity provides CSV/TSV/text file parsers for Java. Use this tag for questions when using their parser and also include other tags to indicate what other issues or frameworks are involved

Univocity provides open-source parsers with a wide range of features to read data by fields, into JavaBeans; writing delimited files, routines to provide short-cuts to common steps, and handling heading rows.

See also

120 questions
1
vote
1 answer

uniVocity parsers to handle two files

I am using uniVocity in order to parse two different files. For every line of the first file I need to iterate through file 2 in order to make some comparisons. RowListProcessor rowProcessor = new RowListProcessor(); CsvParserSettings…
dearn44
  • 3,198
  • 4
  • 30
  • 63
1
vote
1 answer

Univocity Parsers: Calling a function from here is not working: parserSettings.selectFields( *some_function* );

I am using a .csv file and would like to pass a string constructed by a function to: parserSettings.selectFields( function ); During testing, when the string returned by the function is pasted directly into: parserSettings.selectFields( string );…
65535
  • 523
  • 1
  • 10
  • 32
1
vote
1 answer

Univocity - writing out surrounding quotes even if field does not contain delimiter char

I have a file unloaded from a database in such a way that all varchar columns are surrounded by quotes, regardless of the actual content of the column (unfortunately the unload proces is out of my control). Like this: 1,"Alex…
Sander_M
  • 1,109
  • 2
  • 18
  • 36
1
vote
1 answer

Univocity - writing out quote escape character using RowWriterProcessor

I am using univocity to parse files to beans, perform some magic on the objects, and afterwards write the beans back to a file. The code snippet that duplicates my problem: public class Sample { public static void main(String[] args) throws…
Sander_M
  • 1,109
  • 2
  • 18
  • 36
1
vote
1 answer

java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String when using Univocity

I am trying to read a java.sql.Date field and parse it to a java bean using Univocity with the following code: public class Example { public static void main(final String[] args) throws FileNotFoundException { final…
Sander_M
  • 1,109
  • 2
  • 18
  • 36
1
vote
1 answer

Univocity - Is it possible to parse a file to a runtime generated bean/class?

I am using univocity to parse some files to javabeans. These beans are compiled classes. However I wish to generate these classes during runtime and then parse the files to the at runtime generated classes. Full code is here: gist A snippet of the…
Sander_M
  • 1,109
  • 2
  • 18
  • 36
1
vote
1 answer

Univocity parser - Handling lines with weird constructs

I am trying to figure the best way to use University parser to handle CSV log file with lines looks like below, "23.62.3.74",80,"testUserName",147653,"Log Collection Device 100","31/02/15 00:05:10…
Ramesh Sivaraman
  • 1,295
  • 3
  • 19
  • 32
1
vote
1 answer

Univocity parser - Iterator way generating scala case classes

Using Univocity framework to do custom parsing requirements. we have an iterator outputing each line as an event by calling parseNext(), we do not want to use "parse(File file)" . We have this Scala case class as the final output but at the moment…
Ramesh Sivaraman
  • 1,295
  • 3
  • 19
  • 32
1
vote
1 answer

how to use uniVocity-parsers to process non-printable character

I would like to use Java with uniVocity-parsers to parse the csv data which is produced by mysql select into outfile. Now I encounter one situation of processing non-printable characters ! The mysql table contains bit(1) column and when using…
CrazyPig
  • 137
  • 12
1
vote
1 answer

Univocity - parse each TSV file row to different Type of class object

I have a tsv file which has fixed rows but each row is mapped to different Java Class. For example. recordType recordValue1 recordType recordValue1 recordValue2 for First row I have follofing class: public class FirstRow implements ItsvRecord { …
VishalS
  • 73
  • 7
1
vote
1 answer

Univocity: When using CsvRoutines to iterate beans, why can't I use iterator remove functionality?

Given I have setup the following iterator (with domain being some class and input being some file): BeanListProcessor beanProcessor = new BeanListProcessor>((Class>) domain); CsvParserSettings parserSettings = new…
Sander_M
  • 1,109
  • 2
  • 18
  • 36
0
votes
0 answers

How can I get the selected columns set from the Univocity CsvParserSettings?

Situation: import wizard is creating CsvParserSettings instance with all selected columns definition CsvParserSettings being handed over to Task to run CsvParser in new Thread need to set there conversions per selected column Question: is there a…
b2405
  • 1
0
votes
0 answers

Univocity parser BatchedColumnProcessor processing batch twice

I am using BatchedColumnProcessor of univocity parser to parse large CSV files. My parser settings are…
mns
  • 329
  • 4
  • 18
0
votes
1 answer

CSV parsing with univocity-parsers and backslash-escaped quotes

I'm having some trouble parsing CSV with backslash escaped qoutes \". Most of lines in source CSV don't include escaped quotes but where there are I can't seem to find appropriate settings for correct parsing. CSV example (each line with 4…
pcenta
  • 11
  • 1
  • 3
0
votes
0 answers

com.univocity.parsers.common.TextParsingException

Trying to read the below data from a CSV results in a com.univocity.parsers.common.TextParsingException exception: B1456741975-266,"","{""m"": {""difference"":…
xuxu
  • 418
  • 5
  • 15