This commit is contained in:
Klaudia 2023-04-18 17:42:57 +02:00
parent 11fb2733e5
commit b69d52b5d7

View File

@ -12,13 +12,11 @@ def process_text(text, nazwisko_user, nazwisko_system):
def join_lines(text ):
lines = text.split("\n" )
joined_lines = [lines[0] ]
for line in lines[1:] :
if line.startswith("[") :
joined_lines.append(line )
else :
joined_lines[-1] += " " + line
return "\n".join(joined_lines )
def remove_empty_lines(text):
lines = text.split('\n' )
@ -26,14 +24,11 @@ def remove_empty_lines(text):
for line in lines :
if line.strip():
non_empty_lines.append(line)
return '\n'.join(non_empty_lines)
def read_tsv(file_path ):
with open(file_path, 'r', encoding='utf-8') as tsv_file :
content =tsv_file.read()
return content
def write_tsv(file_path, content ):
with open(file_path, 'w', encoding='utf-8') as tsv_file :
tsv_file.write(content )
@ -49,7 +44,7 @@ def replace_first_space_with_tab(text):
new_lines.append(line )
return "\n".join(new_lines )
if __name__ == '__main__' :
# wypelnic przed uruchomieniem
# wypelnic przed uruchomieniemm
nazwisko_user =""
nazwisko_system= ""
numer_user =""