How to convert csv to excel file without loosing the date formats
I tried with “Read csv” activity and that’s changing the date format from "1-Jun-22"to “01-JUN-2022”. How can I copy the same format as in .csv to excel?
I tried using “Excel application scope”, but has different issues with other columns.
Hey,
you can use BalaReva CSV Activity
i will help copy from CSV to Excel, without loosing Format
i am attaching the vedio, you can follow it
definitely it will help you BalaReva CSV Activities - RPA Component | UiPath Marketplace
Thanks and Regards
Hey,
you can use this function it will work
DateTime.ParseExact(VarDate.ToString.Substring(0) ,“dd-MMM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“d-MMM-yyyy”)
VarDate is a variable where storing the Input date(if you are using for each row then you can replce the Var date with row(“ColumnName”)
But I have huge data and its taking lot of time. I have another vb.net code which does format the entire column at a stretch, but this issue with conversion from csv to .xlsx is creating a problem for that code as well.
Bottom line is to convert csv to .xlsx without loosing any format
@Ushu - I am getting file currented error if I do it that, but usually we can’t just rename a .csv to .xlsx. That won’t convert the file in the right way per my understanding
It can’t convert the .csv file to .xlsx but it can convert to .xls. If it shows any pop up while opening the converted xls file just click on yes. Then you can see the data that you want
can you keep a static template for excel with the predefined formats for the columns? Then if you use Read csv and write to excel, i hope it will retain the same format based on the format which already predefined.
I think I can create a template as a part of my process itself, this might work, thank you very much for giving this thought. I will keep you posted on how it goes.