diff --git a/tools/extract_asn1.py b/tools/extract_asn1.py new file mode 100644 index 0000000000000000000000000000000000000000..a60a22275957c4e7ed57abef5bfefaf79fa84d07 --- /dev/null +++ b/tools/extract_asn1.py @@ -0,0 +1,23 @@ +# Script to extract complete ASN.1 code from ETSI TS 103 666 series of specifications +# Steps to run: +# 1. Download the specification as a word document and open it +# 2. In "view" menu, select draft or web layout (needed to removed page header and footers) +# 3. Save the document as a text file +# If requested, select "Text ending: MS-DOS" and "End lines with: CR only" +# 4. Call the script: python extract_asn1.py "" +# The script generates ETSI_TS_103_666_asn1_definitions.asn +import sys + +inFile = open(sys.argv[1]) +outFile = open("ETSI_TS_103_666_asn1_definitions.asn", "w") + +copy = False +for line in inFile: + if line.strip() == "-- ASN1START": + copy = True + elif line.strip() == "-- ASN1STOP": + copy = False + elif copy: + outFile.write(line) +inFile.close() +outFile.close()