yaslab / CSV.swift

CSV reading and writing library written in Swift.
MIT License
661 stars 78 forks source link

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

Open AlexPerathoner opened 5 years ago

AlexPerathoner commented 5 years ago

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.

akshit5230 commented 4 years ago

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

zant commented 4 years ago

+1

@akshit5230 thanks for the tip though

dipcse07 commented 1 year ago

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 が行ったように修正されましたが、適切に修正して問題なく使用できるように、実際の問題は何なのか疑問に思っています。