Read CSV. Issue with date formats

Hi All,

Within a process I download a .CSV file from a web. Afterwards, I need to read it but I have the following problem:

Some of the fields are read wrongly because the format is changed in the file (yellows). Instead of “May-19” what I would like to read with UiPath is the real value “01/05/2019” (red value).

Is there any way to do this? Thank you in advance.

Hello @cnavarrova,

Welcome to UiPath Community. Is it possible to attach the file ?

Regards
Balamurugan.S

Hi @balupad14, thanks. Here you go, I have deleted the confidential data.
Example.zip (494 Bytes)

To be more specific, almost all the values from Column “Referencia” are in General format type, but some of them are in this “Custom” format, in which I cannot read the real value.

1 Like

Hello @cnavarrova,

Thank you for providing the sample file . But i need more specific in the file. Please input just 2 rows for test. and give me the expected output. More detail. I can able read the input from your csv file (which you are going to provide 2 sample row data). specify the expected output.

Regards
Balamurugan.S

Hi @balupad14,

Using the activity Read CSV file I get a DT with all the values. If i try to obtain the output from the first row of Column “Referencia” (DT.rows(0).Item(“Referencia”).tostring) is “may-19”, but I need to get “01/05/2019” instead, which is the complete value.

@cnavarrova you can convert that date into format by using CDate function

For Example : DT.rows(0).Item(“Referencia”).tostring = may-19
Try using
CDate(DT.rows(0).Item(“Referencia”)).tostring

@cnavarrova,

I had faced same issue that you’re facing now, What I did for this please follow it.

  1. Open csv file after you download,
  2. Go to Referencia column,
  3. Select whole column and go to Format,
  4. Select Custom and choose a format as mm/dd/yyyy.

That’s it, this will surely help you get a date.

Cheers,
Pankaj

HI @Rashmi,

Thank you for your response.
This is what I obtain: 19/05/2019. It doesn’t read the day properly…

Hi @Pankaj.Patil,

Thank you for your response.

The problem of doing that is that all the numerical values (f. example 231787) change to date as well.

I finally found the solution I wanted. It is pretty simple, just reading the csv file with “read text file activity”…

1 Like

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