Created
May 17, 2025 07:50
-
-
Save otykhonruk/ad4cff00a2cf154befd33c6090efb464 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 sys | |
if len(sys.argv) != 3: | |
print('Usage: absent.py all.txt meet.txt') | |
fn_all, fn_meet = sys.argv[1:] | |
with open(fn_meet) as meet: | |
participants = meet.read().splitlines() | |
with open(fn_all) as all_: | |
all_ = all_.read().splitlines() | |
participants_ = ' '.join(a.strip() for a in participants).lower() | |
for s in all_: | |
rec = s.split(maxsplit=3) # П І Б частина | |
surname, *_, unit = rec | |
if surname.lower() not in participants_: | |
print(f"{' '.join(rec[:3])}, {unit}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment