32 lines
719 B
Python
Executable File
32 lines
719 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
|
|
def process_line(line):
|
|
line = line.rstrip(" \n")
|
|
if line == "|-":
|
|
return
|
|
if not line.startswith("|"):
|
|
return
|
|
line = line.lstrip("| ")
|
|
line = line.replace("[[", "")
|
|
line = line.replace("]]", "")
|
|
line = line.replace("User:", "")
|
|
|
|
splitted = [x.strip() for x in line.split("||")]
|
|
if len(splitted[0].split("|")) == 2:
|
|
splitted[0] = splitted[0].split("|")[1]
|
|
if splitted[1] == "":
|
|
splitted[1] = "-"
|
|
if splitted[2] == "":
|
|
splitted[2] = "-"
|
|
|
|
print(f"{splitted[0]}\t{splitted[1]}\t{splitted[2]}")
|
|
|
|
def main():
|
|
for line in sys.stdin:
|
|
process_line(line)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|