From a13a5ab01c709e9bcd79144b310757bd954aac22 Mon Sep 17 00:00:00 2001 From: berionnem Date: Tue, 2 Jul 2019 02:21:07 +0200 Subject: [PATCH] Update tools/extract_asn1.py --- tools/extract_asn1.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/extract_asn1.py diff --git a/tools/extract_asn1.py b/tools/extract_asn1.py new file mode 100644 index 0000000..a60a222 --- /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() -- GitLab