Krona
Krona copied to clipboard
Weird behavior when using \r\n as the line terminator
Hi, This is not an issue per say but I thought I'd share this. I had a very hard time getting the ktImportText script to work. I'm using Python to generate the txt file to import and it turns out the csvwriter uses \r\n as line termination by default (on linux as well). The categories wouldn't merge and it drove me quite insane for a few hours,. Manually playing with the file to see if some weird category name was causing a problem would sometime fix it if I happened to 'add' a line... turned in circle for a while.
For example: with open('krona.txt','w') as f: wr = csv.writer(f,delimiter="\t") wr.writerows(somerow)
One has to override the line terminator like this: wr = csv.writer(f,delimiter="\t",lineterminator="\n")
Works fine now...