diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/dsevent-parser.iml b/.idea/dsevent-parser.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/dsevent-parser.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..9940ce4 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a6218fe --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3f221af --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.~lock.test.csv# b/.~lock.test.csv# new file mode 100644 index 0000000..f9ff9f4 --- /dev/null +++ b/.~lock.test.csv# @@ -0,0 +1 @@ +,astatin3,acer,09.07.2024 11:21,file:///home/astatin3/.config/libreoffice/4; \ No newline at end of file diff --git a/.~lock.vel_3.csv# b/.~lock.vel_3.csv# new file mode 100644 index 0000000..6e85c9d --- /dev/null +++ b/.~lock.vel_3.csv# @@ -0,0 +1 @@ +,astatin3,acer,09.07.2024 12:08,file:///home/astatin3/.config/libreoffice/4; \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..223dba0 --- /dev/null +++ b/main.py @@ -0,0 +1,61 @@ +import sys +import re + +def split_with_xml_tags(text): + pattern = r'(<[^/][^>]*>)|([^<]+)' + matches = re.findall(pattern, text) + return [match[0] if match[0] else match[1] for match in matches] + +array = [] + +with open(sys.argv[1], 'r') as f: + data = f.read() + log_data = split_with_xml_tags(data) + + data = [None, None, None] + type_id = -1 + for i, log in enumerate(log_data): + match log: + case "": + type_id = 0 + continue + case "