java - Efficiently store easily parsable data in a file? -


I need to store passable data easily in a file as the option of database backed solution (not to debate) is. Since many of its data is going to be stored, it will be a light syntax, it is not necessarily necessary to be human readable, but it should be personal. Note that there are going to be many types of fields / columns, some of which can be used and none of these

without my database, I see many options, all the problems CSV - I could technically do this, and it is very light though parsing would be an issue, and then it would suck if I wanted to add a column. Multilanguage support isfy, mainly people's own custom parser

  • XML - this is the perfect solution from many fronts, except that parsing and overhead are a lot of tags and a huge file will be generated, and parsing Much resources will be consumed. However, in fact every language supports XML
  • JSON - it's middle ground, but I really do not want to do this because it is a strange syntax and parsing is not trivial. Language support is iffy
  • So everyone has their own disadvantages. But what would be best if trying to target language support and some small file sizes?

    If you're just using the basics of all these formats, all parsers are trivial if CSV is an option, so for XML and JSON, you are talking on names / value pairs blocks, so it does not even include a recursive framework. Json.org is very much support for any language.

    He said.

    I do not know what the problem is with CSV, if people write bad parsers then it is very bad. If you are concerned about compatibility, then adopt the default CSV model from Excel. Anyone who can not parse CSV from Excel, is not going too far into this world. In CSV you will get the most vulnerable support New lines and carriage returns If this is not your data, then this is not a problem. Only another issue quotation is embedded, and they are saved in CSV. If you do not need both of them, then even more trivial than that.

    For "Adding Columns", you have all these problems. If you add a column, then you want to rewrite the whole file. I do not see this one big issue.

    If space is your concern, CSV is the most compact, after JSON, XML. None of the resulting files can be easily updated. They will have to rewrite too much for any changes in all data. The advantage of CSV is that it has been easily added because there is no end element (such as JSON and XML).


    Comments

    Popular posts from this blog

    Eclipse CDT variable colors in editor -

    AJAX doesn't send POST query -

    wpf - Custom Message Box Advice -