While converting xlsx to CSV date format change

Hi all.i have created date format dd/mm/yyyy in xlsx and while converting xlsx to CSV date format is gone it’s showing like dd-mm-yyyy so how to fix this issue…I want same date formate after conversion.even though I tried opening CSV nd use assign activity dtcsv.rows(0)(0) nd paste date format dd/mm/yyyy still not reflecting

Hi @sayali_rokade

Try reading the excel file using the Excel Application Scope and Read Range with Preserve Format option being checked.

Then write the data table to csv.

Hey!

Let’s try like this…

Create one temp data table with desired columns

  1. Read xlsx using read range-output as -Dtout
  2. Take one for each row activity and pass the DtOut
    3.Take one Assign activity Create one datetime variable and pass the expression like this
Datetime.ParseExact(Strinput.ToString, "dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

Take one add data row

And pass the column positions in array of row

{CurrentRow(0).ToString,DateTime, CurrentRow(2).ToString}

Then use write to CSV

Try this and let me know

Regards,
NaNi

Not working

Did not understood.see my xlsx file is ready which contains date format like dd/mm/yyyy but while converting into CSV it prints dd-mm-yyyy


See this is simple activity but date format got change which I want same like xlsx

Hey!

Follow the above process step by step…

You can achieve this…

Take your time and do the each step…

Regards,
NaNi

Thanks do u have any xaml for same because I didn’t understand…I want date in dd/mm/yyyy when I cnvrt it into csv

.CSV removes all the formats while saving… Save in some other formats

Also, check your system date format, CSV will take the system format

Read Excel Sheet (Output DT)
Then Take Invoke Code :
For each r as Datarow in DT.asenumerable
r(“Date”) = Datetime.ParseExact(r(“Date”).To string,“dd-MM-yyyy”,Globalization.cultureinfo.invariantculture).Tostring(“dd/MM/yyyy”)
Next r

Hi @sayali_rokade

Could you please right click on the csv file and select the edit option from the menu.
It will open the csv file in notepad (if not so, please open the csv file in notepad)
Check the date format, it will be the required format

image