Created
November 20, 2018 13:42
-
-
Save tsukanov-as/4c2a587718aea820ec0b5ab61122b0e7 to your computer and use it in GitHub Desktop.
Конвертация отчета об ошибках конфигуратора в группированный список
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
f = open("C:/temp/синтаксические ошибки.txt", mode="r", encoding="utf-8") | |
m = collections.defaultdict(list) | |
for line in f.readlines(): | |
i = line.index(" ") | |
m[line[:i]].append(line[i+1:]) | |
r = open("syntax_errors.txt", mode="w+", encoding="utf-8") | |
for k, v in m.items(): | |
r.write("\n"+k+":\n") | |
for x in v: | |
r.write("\t[] "+x) | |
r.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment