gaurav
gaurav

Reputation: 21

How to automatically convert a text file into a Graphviz DOT file?

I am using Graphviz as my visualization software for a network analysis program.The output of my program us a text file which contains edge connections between the nodes,but the input for Graphviz is a .dot format. so can anyone tell me how to convert .txt to .dot file or is there any software that can convert it into .dot format? P.S. My ouptut file contain close to 8,000 nodes and working on windows platform.

Upvotes: 0

Views: 4815

Answers (2)

I82Much
I82Much

Reputation: 27326

You will need to either

  1. Modify the program which is producing said plain text output to produce a DOT output instead (which is also plain text, but adheres to a specific grammar)
  2. Create a script which parses the plain text file output and converts it into DOT format.

If you post a snippet of the output file, we can help more. This is probably a 2 or 3 line shell, awk, or python script.

Upvotes: 1

RStrad
RStrad

Reputation: 162

As far as I can tell the dot file format is a grammar as defined by http://www.graphviz.org/doc/info/lang.html

And here is an example of it in use http://www.graphviz.org/content/cluster

Upvotes: 0

Related Questions