Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>About <em>selecting existing</em> flat file formats:</strong> There is the <a href="http://en.wikipedia.org/wiki/Comma-separated_values" rel="nofollow noreferrer">Comma-separated values</a> (CSV) format. Or, more generally, <a href="http://en.wikipedia.org/wiki/Delimiter-separated_values" rel="nofollow noreferrer">DSV</a>. But these are not "fixed-width", since there's a delimiter character (such as a comma) that separates individual cells. Note that though CSV is <a href="http://tools.ietf.org/html/rfc4180" rel="nofollow noreferrer">standardized</a>, not everybody adheres to the standard. Also, CSV may be to simple for your purposes, since it doesn't allow a rich document structure.</p> <p>In that respect, the standardized and only slightly more complex (but thus more useful) formats <a href="http://en.wikipedia.org/wiki/JSON" rel="nofollow noreferrer">JSON</a> and <a href="http://en.wikipedia.org/wiki/YAML" rel="nofollow noreferrer">YAML</a> are a better choice. Both are supported out of the box by plenty of languages.</p> <p>Your best bet is to have a look at all languages listed as non-binary in <a href="http://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats" rel="nofollow noreferrer">this overview</a> and then determine which works best for you.</p> <p><strong>About <em>describing</em> flat file formats:</strong> This could be very easy or difficult, depending on the format. Though in most cases easier solutions exist, one way that will work in general is to view the file format as a <a href="http://en.wikipedia.org/wiki/Formal_grammar" rel="nofollow noreferrer">formal grammar</a>, and write a <a href="http://en.wikipedia.org/wiki/Lexical_analysis" rel="nofollow noreferrer">lexer</a>/<a href="http://en.wikipedia.org/wiki/Parser" rel="nofollow noreferrer">parser</a> for it. But I admit, that's quite<sup>&dagger;</sup> heavy machinery.</p> <p>If you're lucky, a couple of advanced <a href="http://en.wikipedia.org/wiki/Regular_expression" rel="nofollow noreferrer">regular expressions</a> may do the trick. Most formats will not lend themselves for that however.<sup>&Dagger;</sup> If you plan on writing a lexer/parser yourself, I can advise <a href="http://www.dabeaz.com/ply/" rel="nofollow noreferrer">PLY</a> (Python Lex-Yacc). But many other solutions exists, in many different languages, a lot of them more convenient than the old-school <a href="http://dinosaur.compilertools.net/" rel="nofollow noreferrer">Lex &amp; Yacc</a>. For more, see <a href="https://stackoverflow.com/questions/428892/what-parser-generator-do-you-recommend"><em>What parser generator do you recommend?</em></a></p> <hr> <p>&nbsp;&nbsp;<sup>&dagger;</sup>: Yes, that may be an understatement.<br> &nbsp;&nbsp;<sup>&Dagger;</sup>: Even properly describing the <a href="http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html" rel="nofollow noreferrer">email address format</a> is not trivial.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload