How to edit CSV file to append text at the begining

I have a requirement to be able to generate a CSV file which has “UTF-8” as the starting line and after that it will have headers and then data.

Has anyone done this before?

Expected output :

Here’s a quick and dirty proof of concept. I’m on the fence on whether it’s production-worthy, so test thoroughly and use at your own risk.

community-2216_2018_02_27.slp (7.9 KB)

1 Like

Thanks a lot!
Works for me.

I am getting the output, but getting an extra new line due to line separate usage.
How to prevent the extra lines from being written.

Could you write a file with just ‘UTF-8’ then perform FILE WRITE with APPEND to achieve what you want?

No actually as I have to write the csv file to a zip

seem like you need another python script to perform a prefix “UTF-8\n” to your document.