You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CMSIS-DSP/Testing/filterLinkScript.py

18 lines
326 B
Python

import sys
import re
filePath = sys.argv[1]
text = None
with open(filePath, "r") as f:
text = f.readlines()
if text:
with open(filePath, "w") as f:
for l in text:
if not re.match(r'^#.*$',l) and not re.match(r'^[ ]+[0-9].*$',l):
f.write(l)
#print(l.rstrip())