Click here to Skip to main content
15,914,488 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi ,

I got scan data with extension of .dot files ,i want convert this to json format file using .net application.can anybody suggest me how i can do, please.

What I have tried:

i tried in google convert .dot file to json ,i got couple of links.but i didn't get exact solution.
Posted
Updated 27-Nov-16 23:43pm

1 solution

A .dot file is for no apparent reason the less favoured extension of a file containing data in the Graph description language DOT (graph description language) - Wikipedia[^]

So first you have to learn what encoding to read it with, i'd try UTF8 first which is presumed default in .dot files The DOT Language[^]

Next up you make a class Which adheres to the schema of the most resent link and then make a parser for the .dot file and excavate data to populate your class, finally you simply use the Json serializer of choise to generate json.
Try default first (System.Web.Extensions) and if it doesn't opt for Newtonsoft.JSON via nuget as it has a much nicer to work with way of making custom serialization.

And just to beat the possible immediate question ... "so is there a way to do this without getting ones hands out of the pockets and just new up something somebody else did ?" (beyond the geeky WHY question to that question) the answer appears to be NO, not for .net keep in mind that an important difference between the two formats is that .dot og .gv files have a contextual specific format where as json is more of a convention for object representation so the two formats are not inherently exchangeable although some specific instance of a json document (adhearing to specs of DOT files) can be.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900