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
2 answers

Recursive object write to flat csv file

I need to write object such class User { UUID id; String name; Role role; } class Role { String name; LocalDate activeFrom; Authority owner; } class Authority { String name; } The tricky think is that csv writing…
masterdany88
  • 5,041
  • 11
  • 58
  • 132
0
votes
2 answers

Spark java.lang.NoSuchMethodError for Univocity CSV Parser setDelimiter method

I'm trying to run a Scala Spark job that uses the Univocity CSV Parser and after upgrading to support a String delimiter (vs only character), I'm getting the following error when I run my jar in the cluster. Running it locally in my IDEA IDE…
0
votes
1 answer

Spark Univocity parser - LineSeparatorDetection not working

I am trying to parse this csv file using univocity csv parser with the following options options : HEADER -> true DELIMITERS -> , MULTILINE -> true DEFAULT_TIME_STAMP -> yyyy/MM/dd HH:mm:ss ZZ IGNORE_TRAILING_WHITE_SPACE ->…
H.Aadhithya
  • 205
  • 1
  • 12
0
votes
3 answers

Getting com.univocity.parsers.common.TextParsingException while loading a csv file

I'm trying to join a tsv dataset which has a lot of new lines in the data to another dataframe and keep getting com.univocity.parsers.common.TextParsingException I've already cleaned my data to replace \N with NAs as I thought that could be the…
noobnoob
  • 167
  • 3
  • 15
0
votes
2 answers

CSV File with values having single quote within quote text qualifier

I am trying to parse a CSV file which has single quote as text qualifier. The problem here is that some values with single quote text qualifier itself contains single quote e-g: 'Fri, 24 Feb 2017 17:44:57 +0700','th01ham000tthxs','/','','Writer's…
0
votes
1 answer

univocity parsing into bean results in null value

I am trying to use the univocity csv parser to parse a csv file with more than 3 million rows into list of java beans. I set it up like in my example, but when I parse the csv every java bean has null attribute values. I played around with the…
htz
  • 1,037
  • 1
  • 13
  • 37
0
votes
1 answer

Premature EOF when loading large CSV file using univocity parser.

Caused by: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) at…
0
votes
1 answer

Univocity CSV parser glues the whole line if it begins with quote "

I'm using univocity 2.7.5 to parse csv file. Till now it worked fine and parsed a row in csv file as String array with n elements, where n = number of columns in a row. But now i have a file, where rows start with quote " and the parser cannot…
0
votes
1 answer

Using setStrictHeaderValidationEnabled method in csvRoutines not working

I am creating a bean processor and setting setStrictHeaderValidationEnabled to true. Now my CsvParserSettings are consuming this bean processor which in turn is consumed by CSVRoutines. But on iterating through csvroutines the bean processor does…
Harsh
  • 75
  • 5
0
votes
3 answers

Parse CSV file but no formatting except delimiting the data

I have data in the below format PAL : PAL : NF : "INCOME"."Taxable" PAL : PAL : NF : "EXPENSES"."TotalExpenses" PAL : PAL : NF : "EXPENSES"."Exceptional" In java, i just want to delimit the data without doing any formatting, in the outputs also…
bobby.dreamer
  • 366
  • 4
  • 19
0
votes
1 answer

uniVocity parser to handle duplicate header names

How can I read a csv file which has duplicate column names by using BeanParser. Below is the example header Col desc, Col amount, Col desc, Col amount test, 12.44, test2, 43.44
0
votes
0 answers

How to use C-Style Escape in Univocity

I'm converting ResultSet object into csv format string using Univocity using below code: `StringWriter stringWriter = new StringWriter(); CsvWriterSettings settings = new…
HyperioN
  • 3,433
  • 2
  • 22
  • 36
0
votes
1 answer

Changing order of comment section in CSV file using univocity

I am using univocity CSV parser to export my contents to CSV file. Here is my expected CSV file output, #Comment Section-1 #Comment Section-2 Header-1,Header2,Header3 Data-1,data-2,data-3 But while exporting the contents to CSV file i am getting…
Hakuna Matata
  • 755
  • 3
  • 13
0
votes
1 answer

Parsing a multi-schema Record in Fixed Width

0000321C#Miss Foo 23234HSBCA#123433-000HSBCAUS 00234HSBCB#222343-130HSBCCADCE 0000322C#Mr Bar The given file is fixed width and the record containing A#,B# and C# maps to different models. (A#,B#andC# being the record indicators) I did…
-3
votes
1 answer

I want to skip check for maxchar in univocity into my project

I want to skip the check of setMaxCharPerColumn(10000) of univocity csv parser in my project. Is there any settings to skip this? Thanks
avy
  • 417
  • 1
  • 9
  • 21
1 2 3 4 5 6 7
8