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
0
votes
0 answers

Error while compressing CSV and JSON file with pyspark

I am trying to write a CSV file with snappy compression. The code I have written for it is - df.write.format('csv').option("compression","snappy").option('header','true').save('R') But I encounter the following error everytime - Caused by:…
0
votes
1 answer

Apache Camel: Univocity Map Unmarshalling NullPointer

Good afternoon, playing around with Univocity CSV unmarshalling. Using this route works fine for marshalling to a list but using the asMap=true option fails with a Nullpointer exception. Is there anything obvious missing? Currently using Spring Boot…
Kirst
  • 1
0
votes
1 answer

univocity csv parser setTypeOfColumns not working

This test fails with: expected: but was: @Test public void testSetTypeOfColumns() throws IOException { String data = "ID,NAME" + System.lineSeparator() + "2,Chris"; InputStream csvStream = new…
cheenu
  • 138
  • 2
  • 8
0
votes
1 answer

Format ResultSet to specific DecimalFormat in Univocity Parser

In my project I've been using Univocity-parsers to convert SQL queries into CSV files. It used to first map the queries to Java Beans and then used CsvRoutines to write the CSV. public static class Bean { @Parsed(field = "double_value") …
Jaims
  • 1,515
  • 2
  • 17
  • 30
0
votes
1 answer

Convert flattened CSV to nested JSON

I want to create a nested JSON from a flattened CSV: CSV: name address_city address_state John Mumbai MH John Bangalore KA Bill Chennai TN JSON: [ { "name": "John", "address": [ { "city": "Mumbai", …
HyperioN
  • 3,433
  • 2
  • 22
  • 36
0
votes
1 answer

Univocity parsers custom line separator

I'm reading a CSV from a legacy system that has multi line records separated by ,END. I'm trying to use Univocity parsers to parse the CSV line by line where each 'line' runs until ,END. I have tried using .setLineSeparator(",END"); but it seems to…
Steve Fitzsimons
  • 3,754
  • 7
  • 27
  • 66
0
votes
1 answer

Univocity - Parsing a fixedwidth flat file with one row - performance impact with 300 parallel threads

We have a project that deals with millions of transactions everyday which has some tight SLAs. As part of parsing the flat file that comes as input to a bean , we used beanio which was working better with out load. But with load its taking around…
0
votes
1 answer

Can I speed up uniVocity CSV Parser?

I'm working on a project that is using the uniVocity CSV parser to read an InputStream which contains CSV data. Overall the CSV parser is working great, however there is one line which seems to be slow. When I call the beginParsing() method, it…
cgivre
  • 513
  • 4
  • 21
0
votes
1 answer

Annotated bean to partial record using Univocity

I’d like to make Univocity use annotated bean instances to determine a part of the CSV contents, namely, the first few columns only. The rest of the columns are provided by some complicated programming logic, that is independent of the bean…
Olivier Cailloux
  • 977
  • 9
  • 24
0
votes
2 answers

Univocity CSV parser skip rows based on conditions

Is it possible to configure Univocity CSV parser to skip some rows based on predefined conditions like for example values in the cells? For example I have the following CSV file: name,city Alex,NY Mike,London Dan,Sydney and I'd like to skip from…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
0
votes
1 answer

Univocity master detail relationship beans

I have a fixed structured file like this 5 type records, GM, AB, TM, DM, IN TM and DM as you see is a master-detail relationship but also DM and IN are in a master-detail relationship GM01012020 ABXX-43432 TM CODE1 DM …
0
votes
0 answers

Flat file Item reader, custom record delimiter

I have a requirement to parse flat file of column1|column2|column3$# data1|data2|data3$# Where | - pipe line delimiter $# - record delimiter Flat file item reader: I tried to use the custom record separator policy, in which I tried to override…
CodeGame
  • 1
  • 5
0
votes
0 answers

how to allow shorter lines in camel univocity fixed parser?

i have file like this 12345678 12345678 123 i have set two headers on UniVocityFixedWidthDataFormat with names num1 and num2 with length 5 and 3. the parser is able to read first two lines with ease, but it throws null pointer exception at third…
arshid dar
  • 1,355
  • 2
  • 15
  • 23
0
votes
0 answers

Why does my Univocity parser slow way down when I change the data type of a field in my java class?

I am about 3 days into my experience with this tool. Everything was going great, I have a file with 3 record definitions (header, data, trailer) and am using an InputValueSwitch with 3 beanListProcessors. The data object has about 40 properties all…
Big D.
  • 131
  • 1
  • 4
0
votes
1 answer

How to use spring-batch to write the list of items returned by univocity into a database

I have a series of steps which involves: Step1: Read from database and write to csv (first-leg) Step2: Read from database and write to csv (second-leg) Step3: Integrate spring-batch with Univocity to compare the CSVs from first-leg and second-leg…
bost
  • 3
  • 5