CSV.swift icon indicating copy to clipboard operation
CSV.swift copied to clipboard

Appending while writing to file doesn't create a new row

Open AlexPerathoner opened this issue 5 years ago • 3 comments

Just as the title says, when I'm writing to a file which is using a stream with the append argument set to true, the CSVWriter is writing the first row on the last already written row. Then it works properly.

AlexPerathoner avatar Sep 12 '19 14:09 AlexPerathoner

I did a workaround by writing try! csv.write(row: [""]) before appending the actual row. Then it creates a new row. 😁

akshit5230 avatar Dec 07 '19 14:12 akshit5230

+1

@akshit5230 thanks for the tip though

zant avatar Mar 23 '20 01:03 zant

I did a workaround by writing try! csv.write(row: [""]) before appending the actual row. Then it creates a new row. 😁

@yaslab.. In my case When i append to an existing csv created by another library that worked fine.. but when i created a new csv using this library and then tried to append.... i had the same issue and fixed as @akshit5230 did but wondering what is the actual issue so that we can fix it properly and we can use it without any kind of issue.

私の場合、別のライブラリによって作成された既存のcsvに追加すると、正常に機能しました..しかし、このライブラリを使用して新しいcsvを作成し、追加しようとすると同じ問題が発生しました。 @akshit5230 が行ったように修正されましたが、適切に修正して問題なく使用できるように、実際の問題は何なのか疑問に思っています。

dipcse07 avatar Feb 08 '23 08:02 dipcse07