Martin Velez
Martin Velez

Reputation: 1429

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

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;
}

Upvotes: 7

Views: 2689

Answers (1)

Martin Velez
Martin Velez

Reputation: 1429

BEG_G {
  fname = sprintf("%s.dot",$G.name);
  writeG($G, fname);
}

Upvotes: 6

Related Questions