source: branches/properties/SH/arb_nexus2newick.awk

Last change on this file was 10447, checked in by aboeckma, 11 years ago

Added mrBayes gde menu

  • Property svn:executable set to *
File size: 515 bytes
Line 
1#!/usr/bin/awk -f
2BEGIN {
3  in_trees = in_translate = 0;
4}
5/begin trees;/ { 
6  in_trees = 1; 
7}
8in_translate && /;/ {
9  in_translate = 0
10}
11in_translate {
12  sub(/,$/,"")
13  map[$1]=$2
14}
15in_trees && /translate/ { 
16  in_translate = 1;
17}
18in_trees && /\[/ {
19  in_comment = 1;
20}
21in_comment
22in_comment && /\]$/ {
23  in_comment = 0;
24}
25in_trees && /tree [^ ]* =/ {
26  for (i in map) {
27     a=0;
28     a+=gsub("[(]"i":","("map[i]":", $4)
29     a+=sub(","i":",","map[i]":", $4)
30     if (a!=1) print i " " map[i]
31  }
32  print $4
33 
34}
Note: See TracBrowser for help on using the repository browser.