About univocity-parsers
Download and see for yourself.
Consistent API
All parsers share a common API. Don't waste time learning a new API for each different text format.
Fast
Our parsers are micro optimized to be the fastest among any alternatives.
Feature-complete
We work very hard to ensure our parsers provide all features and flexibility you look for when processing data.
Open-source
univocity-parsers is licensed under the Apache license 2.0. Check it out on github
Flexibility
Map records to simple Strings:
String[] row;
while ((row = parser.parseNext()) != null) {
System.out.println(Arrays.toString(row));
}
Or convert them to Objects:
rowProcessor
.convertFields(Conversions.toDate("yyyy-MMM-dd"))
.set("dateOfBirth", "dateJoined");
Or even fields i n JavaBeans, using annotations:
@Trim
@LowerCase
@BooleanString(falseStrings = { "no", "n", "null" }, trueStrings = { "yes", "y" })
@Parsed
private Boolean pending;
You can easily define custom processors to execute all sorts of operations over the records, and even write your own parser for your specific format.
Field selection
Don't waste resources and processing power parsing unwanted values. You can select specific fields on an input text and get only values from these, in the order you specify.
For example, using the following CSV:
Year,Make,Model,Description,Price
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
You can select some fields:
parserSettings.selectFields("Price", "Year", "Make");
To produce:
3000.00, 1997, Ford
4900.00, 1999, Chevy
When writing, simply define what values you have for each record, in whatever order you need, and univocity-parsers will write all records in the correct format.
writer.writeRow(3000.00, 1997, "Ford");
writer.writeRow(4900.00, 1999, "Chevy");
The result will be:
Year,Make,Model,Description,Price
1997,Ford,,,3000.00
1999,Chevy,,,4900.00
Parellel input buffering
Parsers written on top of univocity-parsers architecture will buffer input files' content using a separate thread to optimize the processing of large inputs even further.