From 72b8a1ab3d233e9c697174ebe77f92f8bcef88c3 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Sat, 10 Jul 2021 00:01:14 +0200 Subject: [PATCH] Fix trailing whiteline added after metadata --- output2txt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/output2txt.py b/output2txt.py index 7d922f1..c877c6e 100644 --- a/output2txt.py +++ b/output2txt.py @@ -47,13 +47,12 @@ def outputToTxt(folderLocation, printRaw, songObj): lineCounter = 0 # Write metadata - for line in songObj.metadata.split('\n'): + for line in songObj.metadata.splitlines(True): # remove any unwanted characters from metadata - line = line.rstrip() if not songObj.keepEmptyLines and not line: continue #print("meta line '{}'".format(line)) - output += line + '\r\n' + output += line metadataLines.append(lineCounter) lineCounter += 1