#!/usr/bin/gawk -f BEGIN{ attr=0; class="class"; dataLine=0; first=1; names=".names"; data=".data"; cfg=".cfg"; file="file"; IGNORECASE=1; } /%/{next;} first{ names=file names; data=file data; cfg=file cfg; first=0; } /@attribute/{ sub ( /@attribute * /, "" ); gsub( "'", "" ); sub ( / \{/, ": " ); sub ( /\}/, "" ); sub ( "real", ": continuous" ); sub ( "number", ": continuous" ); sub ( "integer", ": continuous" ); sub ( " :", ": " ); attrs[attr++]=$0; class=$0; } dataLine{ gsub( "'", "" ); print $0 >> data; } /@data/{ sub( /.* /, "", class ); print class >> names; for( curAttr=0; curAttr < attr - 1; curAttr++ ) print attrs[curAttr] >> names; dataLine=1; } END{ print "granularity: 2" >> cfg; print "maxNumber: 3" >> cfg; print "maxSize: 100" >> cfg; print "randomTrials: 50" >> cfg; print "futileTrials: 5" >> cfg; print "bestClass: 30%" >> cfg; }