How to create batch file and generate a series digraph from a series .dot files?

Hi, every body.

I have a lot of .dot files, I need to execute these in GraphViz program package at once in Windows7 or Mac OS, and generate corresponding digraphs.

Please help me to create batch file and generate a series digraphs from a series .dot files.

thank you.

You can just put all of the

You can just put all of the commands you want to execute into a file and run that in a command shell. For example, on a Mac, you could have a file dodot.sh containing:

dot -Tpng -o a.png a.gv
dot -Tpng -o b.png b.gv
dot -Tpng -o c.png c.gv

 

Make the file executable and run it:

chmod 775 dodot.sh
dodot.sh

This assumes the bin directory for Graphviz is in your PATH environment variable. If not, you either have to add it or use the full path name in the script.

You can do roughly the same things on Windows in the dos command shell, calling your file dodot.bat. I don't believe you need to explicitly make the bat file executable.

 

Recent comments