I have a file say f1 in the following format:
digraph G {
rankdir=TB;
node [style="filled", ];
2 [label="Decl n1", fillcolor="#FFEFD5", shape=box, ];
3 [label="In1", fillcolor="#6495ED", shape=box, ];
4 [label="Decl n2", fillcolor="#FFEFD5", shape=box, ];
5 [label="In2", fillcolor="#6495ED", shape=box, ];
...........
edge [dir=back, ];
3 -> 2 [color="#000000", style="dotted", ];
2 -> 3 [color="#000000", style="dotted", ];
...........
}
I need to modify it such that each list is reversed and the "," at the end of the list should be removed. For example, the output format should be like:
2 [shape=box, fillcolor="#FFEFD5", label="Decl n1"];
How do I approach this problem? Do I have to use any scripts? I am not very familiar with shell scripts.