4 ms·
and now please, build a tool which converts all these thinks, like imagemagick for machinereadable documents.
by deknos 6y ago
and now please, build a tool which converts all these thinks, like imagemagick for machinereadable documents.
- hermitcrab 6y agoIf you mean convert between data formats (e.g. between, CSV,YAML,JSON, XML) there are programs already that can do that. For example our Easy Data Transform. However there are wrinkles because some of these formats are trees and some are tables. Flattening a tree into a table isn't too hard. But unflattening a table back into the same tree as the original is trickier. Has anyone got any good references on that?
- deknos 6y agodo you have a list for that? i am aware, that there are dialects and {table,trees,graphs}<->{table,trees,graphs} may be a problem for some languages, but having it at least would be a progress.
- hermitcrab 6y agoDo you mean a link? If so: https://www.easydatatransform.com/ https://www.easydatatransform.com/ Just as an example of the tree<->table issue: If you input this JSON tree: { "Color": "Blue", "Part": [ { "Type": "A", "Number": [ "1", "2" ] }, { "Type": "B", "Number": [ "1" ] } ] It can be converted to a table as: Color,Part.Type,Part.Number Blue,A,1 Blue,A,2 Blue,B,1 Which is fine is you then want to output as Excel, CSV etc. But if you then output that back to JSON you get: [ { "Color": "Blue", "Part": { "Type": "A", "Number": "1" } }, { "Color": "Blue", "Part": { "Type": "A", "Number": "2" } }, { "Color": "Blue", "Part": { "Type": "B", "Number": "1" } } ] Which is conceptually equivalent, but less compact (similarly for XML). I am hoping to fix this issue. But if anyone has any links to how to unflatten a table into a compact tree, I'm all ears.
- deknos 6y agoi meant a cli tool :D but thanks
- hermitcrab 6y agoYou can also run it from the command line.