Append to CSV is adding quotation marks

Hey guys,

I have an issue with creating a CSV file. Upon reviewing the DataTable,the number 2-6 have a leading white space. This white space is necessary because without it, the CSV formats it incorrectly as a date. If I open the created file with Notepad, I notice that the Studio has added quotation marks, as depicted below. But that’s incorrect since this CSV File is uploaded in SAP after. How can I avoid the quotation marks?
DataTable:


CSV opened in NotePad:

Thank you & best regards
Alisa

@Alisa_Su

It is a csv formatting …because you added a space the column is considered as text …and sentence with text and space will be automatically surrounded by double quote …even sap should be allowing it

Also 2-6 might not be recognized as date unless while reading it is read as date…so try correcting that…and have the column format as text or so …and space at start can be avoided

Cheers

Hi, thanks for your answer. Do you have any ideas how i can format it as a text?

@Alisa_Su

From where are you getting the data from?

if it is from excel then can use display value instead of raw value or preserve format option so that the value is read as is

cheers

I’m reading the data from an excel, saving it in a DataTable and assign it in die output DataTable. So I have no idea how I can display the value instead of reading the raw value.

@Alisa_Su

in read range activity you would see this option…try with it

if you print the value I believe after reading you would see that excel would have formatted 2-6 as a date

cheer

I tried using the DisplayValue option and removed the white space at the start. CSV is still formatting it incorrect.

@Alisa_Su

what is the display value in your excel?

cheers

@Alisa_Su

looks like it is date in your excel already(so dont use display value)

so in your assign

use like this

dt_UploadFile..... = Cdate(currentRow("Hausnummer").ToString).ToString("d-M")

cheers

Hey,

now it’s only formatting to Day-Month Date.

I also did a Write Line to Output Data Table right before Appending to CSV. Here it’s showing correctly. So there must be something wrong with the Appending to CSV.

@Alisa_Su

try to convert the datatable as string using output datatable

and use write text file and give files name as .csv and check

cheers