As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Do I need a library if I only need to make csv formatted file. I don't need reading and parsing it.
No, you don't. And even reading/parsing can be easily done with a plain JRE.
CSV is a plain (ascii-)text format with only a few rules:
rows (objects) are separated with a \n
columns (fields, attributes) are spearated with a delimiter char (usually a comma, but define whatever you need)
row and column delimiters must not be part of the field values
Unless it's a really trivial part of your application and you're absolutely sure you won't ever need to parse a CSV file, you need a CSV-serialization library.
I have tried openCSV and I'm pretty happy using it. Of course you can write your own class to handle this serialization, but a library always comes with more features at the expense of an extra dependency...
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
It's just a think that makes me wonder.In fact is not a real issue for me.
When I call the java(.exe) from command line is it better to end up the classpath variable with path separator (; in Windows or : in Unix) or it's better without it.
It works both ways , I've seen it both ways - but much more often without.It's not clarified in java help.To me the end-up with separator looks more clear with.Could some of the ways to cause a problem?
EDIT : I suppose it's always a good idea to enclose the classpath in quotes.
My 2c: separator should be placed between two other entities (to separate them). Having the separator at the end could possibly lead to fail when some code is trying to iterate over the array that was obtained by calling the split(SEPARATOR) method on the variable.
Obviously there is no correct answer to your question.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need a stable Java library that I can pass a huge string to (e.g., a few chapters from Moby Dick) and get "word count"-like stats:
Number of paragraphs
Number of sentences
Number of words
Number of characters
Preferably something internationalizable/localizable but not required. I figured Apache Commons would have something like this, but after a thorough search it does not.
I could write this myself but it would probably be buggy and take a lot of time; plus I don't want to reinvent the wheel if it already exists. I am thinking of using Apache Tika but cannot confirm if it will do what I need. It seems to handle word count, but not the others. Thanks in advance.
Take a look at Apache Tika. It might serve your requirements
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
If I have colon separated xml tags like <my:tag>, which library provides easy parsing and value manipulation? What do I have to look for?
The my before the colon is a namespace prefix, and there should be an attribute xmlns:my on either the same element or one of its enclosing elements somewhere higher up which associates a namespace URI with the prefix. All the standard Java XML technologies support namespaces (SAX, DOM and StAX provided with the JRE as well as third party libraries like JDOM and XOM), the thing you need to remember is that you generally refer to elements in any API using the namespace URI and local name (the bit after the colon), not the prefix specifically.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering if there is any api or library available that provides a taxonomy for a given term in jSON.
For instance, if the argument is Shoes, it should return a data structure consisting of all the synonmys or types of shoes like Boots, Flip-flops, Slippers, Stilettos, and so on..
Thanks :)
Your best bet is to use the Java API for WordNet
http://lyle.smu.edu/~tspell/jaws/index.html
You can wrap this inside a servlet and call it via jquery in your application.
JSON is not typed by itself, you have to use another notation to add type to the data encoded in JSON. JSON-LD for example allows to add the concepts of linked data/semantic web to the json data. Using this information it is possible to query the taxonomy that defines the structure of the data.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to parse some HTML in order to find the values of some attributes/tags etc.
What HTML parsers do you recommend? Any pros and cons?
NekoHTML, TagSoup, and JTidy will allow you to parse HTML and then process with XML tools, like XPath.
I have tried HTML Parser which is dead simple.
Do you need to do a full parse of the HTML? If you're just looking for specific values within the contents (a specific tag/param), then a simple regular expression might be enough, and could very well be faster.