0

Happy Thanksgiving!

I have some data that's from the government in csv and the dates are formatted differently. In the same column, I see the following two different date formats:

date_ 
2/22/90 0:00 

date_
11/25/2014 12:00:00  AM   

The file is too big and therefore I cannot open this in Excel and change the formats before reading them into R using the read.csv function.

Does anyone have any idea the best way to handle these data?

Thank you very much!

Trexion Kameha
  • 3,362
  • 10
  • 34
  • 60
  • Hello Richard, I have searched for the last 15 minutes and have not found the duplicate question. Perhaps I'm not searching for the right terms. Can you please point me in the right direct? – Trexion Kameha Nov 27 '14 at 20:54
  • test$y <- ifelse(nchar(test$date_) <=20, "y", "Y") test$asof_dt<-as.Date(test$date_, format = paste0("%m/%d/%", test$y)) – Trexion Kameha Nov 27 '14 at 22:05

0 Answers0