Copy "/" and paste in a column with dates

Hi all;

I have a file whose column Q has dates.
I would like a simple method to replace the “-” by “/”.
Thanks in advance for your quick help.

If you reading data as a string, then you can use YourStringVariableName.Replace("-","/")

Thanks to your feedback but how do you do specify the column Q?

Is it an excel file? If yes,
create a count variable(say countVar) and initialize it to 1,
Use a while loop ,
use read cell activity and specify cell value as “Q” + countVar.toString() and store the output value to YourStringVariableName,
now assign YourStringVariableName = YourStringVariableName.Replace("-","/")
increase countVar by 1,
repeat until there’s data in your Q column

Hi @Al_Bert

  1. Read the excel and store in dt1

  2. Then use the invoke code activitiy with dt1 argument as in/out ,

dt1.AsEnumerable().ToList().ForEach(Sub(row) row(ColumnName) = DateTime.ParseExact(row(ColumnName).ToString,“yyyy-MM-dd HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy HH:mm:ss”))


Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

Hi Nived,

OK, the flow is good, but the dates don’t change :pensive:
ReadSEPCRDT.AsEnumerable().ToList().ForEach(Sub(row) row(DateModified) = row(DateModified).ToString.Replace("-","/"))

Hi @Al_Bert

Can u show how the output is coming?

The flow and the fileimage


In yellow , that I want
In red the format actual

Hi @Al_Bert

I edited my answer

Please check , also while read range , check the preserve format option


Nived N :robot:

Happy Automation :relaxed::relaxed:


I find another way, by a read range on the column Q and write range column Q and the format change automatically.

Thanks to your help and your support.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.