Reading CSV and Writing to Excel changes datatype

excel
activities

#1

I have csv file in which Column1 has date and time value (String as column datatype).
I am using read csv to read.

I need to write this in excel. when I use write range. Here, some of the column1 values are storing as system.string and some of them as system.datetime.

Further I need to compare this column(excel) value with today’s date. but it’s showing error since it has two types of data

can anyone know why it is happening like this ?


#2

Hello there,
Not sure this will help but try this out.


#3

its not redirecting


#4

oops my bad.Check now :wink:


#5

it’s not working for me


#6

Your getting errro because of mismatch in the datatype, so how about convert them to same format before checking the condition.


#7

how to convert them to same format.

b’coz if I treat that as string it’s showing “string converter cannot convert date-time format” and vice versa


#8

You just has to parse the date-time string,

Check this post for the reference.
Still same issue them please upload workflow with excel.


#9

Thanks for the reply.

I am unable to share the workflow due to some reasons.

I tried parsing but the error still exists. since the column contains two types of data i.e, system.datetime and system.string.

so when I tried datetime.parse its showing string was not recognized as valid datetime.


#10

hi,

Please follow the below tutorial,

Thanks,
karthik