echo "sorting ML:"
mlsort -b CML-BaseFile _MLC ratings

echo "creating ML: techno..."
grep _MLC.ratings >_mltechno techno trance " rave" hardcore " house" tribal
join cml-header _mltechno to _ml
mlsort -c _ml _techno ratings
rename _techno.ratings _techno.ml >NIL:
delete _ml _mltechno >NIL:

echo "creating ML: ads..."
grep _MLC.ratings >_mlads " ads" " space" synthpop
join cml-header _mlads to _ml
mlsort -c _ml _ads ratings
rename _ads.ratings _ads.ml >NIL:
delete _ml _mlads >NIL:

echo "creating ML: pop..."
grep _MLC.ratings >_mlpop " pop" disco synthpop
join cml-header _mlpop to _ml
mlsort -c _ml _pop ratings
rename _pop.ratings _pop.ml >NIL:
delete _ml _mlpop >NIL:

echo "creating ML: jazz..."
grep _MLC.ratings >_mljazz jazz groove saxo
join cml-header _mljazz to _ml
mlsort -c _ml _jazz ratings
rename _jazz.ratings _jazz.ml >NIL:
delete _ml _mljazz >NIL:

echo "creating ML: rock..."
grep _MLC.ratings >_mlrock rock "heavy metal" "funk," " funk"
join cml-header _mlrock to _ml
mlsort -c _ml _rock ratings
rename _rock.ratings _rock.ml >NIL:
delete _ml _mlrock >NIL:

echo "creating ML: military..."
grep _MLC.ratings >_mlmilitary military
join cml-header _mlmilitary to _ml
mlsort -c _ml _military ratings
rename _military.ratings _military.ml >NIL:
delete _ml _mlmilitary >NIL:

echo "creating ML: folkx..."
grep _MLC.ratings >_mlfolkx folkx xmas polka
join cml-header _mlfolkx to _ml
mlsort -c _ml _folkx ratings
rename _folkx.ratings _folkx.ml >NIL:
delete _ml _mlfolkx >NIL:

echo "creating ML: reggae..."
grep _MLC.ratings >_mlreggae reggae latin chanson calypso
join cml-header _mlreggae to _ml
mlsort -c _ml _reggae ratings
rename _reggae.ratings _reggae.ml >NIL:
delete _ml _mlreggae >NIL:

echo "creating ML: piano..."
grep _MLC.ratings >_mlpiano piano classic ragtime
join cml-header _mlpiano to _ml
mlsort -c _ml _piano ratings
rename _piano.ratings _piano.ml >NIL:
delete _ml _mlpiano  >NIL:

echo "creating ML: CD..."
grep _MLC.ratings >_mlcd cd
join cml-header _mlcd to _ml
mlsort -c _ml _cd ratings
rename _cd.ratings _cd.ml >NIL:
delete _ml _mlcd >NIL:

echo "creating ML: voices..."
grep _MLC.ratings >_mlvoices voices " singing
join cml-header _mlvoices to _ml
mlsort -c _ml _voices ratings
rename _voices.ratings _voices.ml >NIL:
delete _ml _mlvoices >NIL:

echo "creating ML: dreamy..."
grep _MLC.ratings >_mldreamy dreamy
join cml-header _mldreamy to _ml
mlsort -c _ml _dreamy ratings
rename _dreamy.ratings _dreamy.ml  >NIL:
delete _ml _mldreamy >NIL:

echo "creating ML: atmospheric..."
grep _MLC.ratings >_mlatmospheric atmosph
join cml-header _mlatmospheric to _ml
mlsort -c _ml _atmospheric ratings
rename _atmospheric.ratings _atmospheric.ml >NIL:
delete _ml _mlatmospheric >NIL:

echo "creating ML: fantasy..."
grep _MLC.ratings >_mlfantasy fantasy
join cml-header _mlfantasy to _ml
mlsort -c _ml _fantasy ratings
rename _fantasy.ratings _fantasy.ml >NIL:
delete _ml _mlfantasy >NIL:

echo "creating ML: flute..."
grep _MLC.ratings >_mlflute flute
join cml-header _mlflute to _ml
mlsort -c _ml _flute ratings
rename _flute.ratings _flute.ml >NIL:
delete _ml _mlflute >NIL:

echo "creating ML: guitar..."
grep _MLC.ratings >_mlguitar guitar
join cml-header _mlguitar to _ml
mlsort -c _ml _guitar ratings
rename _guitar.ratings _guitar.ml >NIL:
delete _ml _mlguitar >NIL:

echo "creating ML: eastern..."
grep _MLC.ratings >_mleastern eastern
join cml-header _mleastern to _ml
mlsort -c _ml _eastern ratings
rename _eastern.ratings _eastern.ml >NIL:
delete _ml _mleastern >NIL:

echo "creating ML: orchestra..."
grep _MLC.ratings >_mlorchestra orchest
join cml-header _mlorchestra to _ml
mlsort -c _ml _orchestra ratings
rename _orchestra.ratings _orchestra.ml >NIL:
delete _ml _mlorchestra >NIL:

echo "sorting ML: complete sortings"
mlsort -c  CML-BaseFile _MLC ratings
mlsort -c  CML-BaseFile _MLC abc
mlsort -c  CML-BaseFile _MLC composers
mlsort -c  CML-BaseFile _MLC composer+rating
mlsort -c  CML-BaseFile _MLC types
mlsort -c  CML-BaseFile _MLC type+rating
mlsort -c -b  CML-BaseFile _MLC playtimes
mlsort -c -b  CML-BaseFile _MLC sizes
mlsort -c -b CML-BaseFile _MLC subsongs

echo "creating ML:  ---DONE---"
delete _mlc
list _*.ml

