Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to split a DOT file with multiple graphs into multiple DOT files using GVPR?

Tags:

graph

graphviz

How do you split a file with multiple graphs in the DOT language into multiple DOT files using gvpr?

Input (1 file):

# single.dot
digraph one {
  a -> b;
}
digraph two {
  c -> d;
}

Output (1 graph per file):

# one.dot
digraph one {
  a -> b;
}

# two.dot
digraph two {
  c -> d;
}
like image 418
Martin Velez Avatar asked Feb 22 '13 23:02

Martin Velez


1 Answers

BEG_G {
  fname = sprintf("%s.dot",$G.name);
  writeG($G, fname);
}
like image 101
Martin Velez Avatar answered Nov 15 '22 10:11

Martin Velez