@@ -0,0 +1,1960 @@
+#!/usr/bin/python%0A%0A# A quick and rough script to divide features into sub groups of 3000 lines%0A# It would be good to implement this into Glyphs so we can set feature name automatically if not present%0Aimport re%0A%0A# Maximum number of lines in feature%0AmaxSub = 3000; # 3000 for Glyphs%0A%0A# Global lookup count%0AlookUpCount  = 0%0AfeatureCount = 0%0AfeatureOpen  = False%0AcurrFeature  = %22NameOfFeature%22%0A%0Adef cleanFeatureName(line):%0A%09return ''.join(%5Bi for i in line if not i.isdigit()%5D).replace(%22lookup %22,%22%22,1).replace(%22 %7B%22,%22%22,1).strip('%5Cn')%0A%0Adef process(line):%0A    global lookUpCount%0A    global featureCount%0A    global featureOpen%0A    global currFeature%0A    if 'lookup ' in line.lower():%0A        currFeature = cleanFeatureName(line)%0A        lookUpCount = 0%0A        featureCount += 1%0A        fo.write(%22lookup %22 + currFeature + str(featureCount) + %22 %7B%5Cn%22)%0A        featureOpen = True%0A    elif currFeature in line:%0A        # Close the curent feature%0A        fo.write(%22%7D %22 + currFeature + str(featureCount) + %22;%5Cn%22)%0A        featureOpen = False%0A    elif 'sub ' in line:%0A        if not featureOpen:%0A            lookUpCount = 0%0A            featureCount += 1%0A            fo.write(%22lookup %22 + currFeature + str(featureCount) + %22 %7B%5Cn%22)%0A            featureOpen = True%0A        lookUpCount += 1%0A        if lookUpCount %3C maxSub:%0A            fo.write(line)%0A        else:%0A            # Close the curent feature%0A            fo.write(%22%7D %22 + currFeature + str(featureCount) + %22;%5Cn%22)%0A            # And create a new one%0A            lookUpCount = 0%0A            featureCount += 1%0A            fo.write(%22lookup %22 + currFeature + str(featureCount) + %22 %7B%5Cn%22)%0A            fo.write(line)%0A    else:%0A        if featureOpen:%0A            fo.write(%22%7D %22 + currFeature + str(featureCount) + %22;%5Cn%22)%0A            featureOpen = False%0A        fo.write(line)%0A%0A#Create a new ile to write%0Afo = open('./featuresOutput.txt', 'w');%0A%0Awith open(%22./pastedFeatures.txt%22, %22r%22) as fi:%0A    for line in fi:%0A        process(line)%0A

Create devideFeatures.py