# Convert a specific column to Dateobjects

I have searched around but haven't found an answer to the following problem.

I have a spreadsheet with a large number of rows and 4 columns.

Column 3 contains dates not in a right format. So I want to convert column 3 to date objects and keep everything else.

data1 = {#[[1]],#[[2]],DateObject[#[[3]]],#[[4]]} & /@ Rest@data;


Here data is my imported data from the sheet.

My question: Assume that my sheet contains say 100 columns with Dates in column 37th.

How can I achieve the same thing as above?

• MapAt[DateObject, yourData, {All, 37}] Sep 30, 2021 at 22:07
• @MarcoB Thank so much. This is exactly what I wanted. Sep 30, 2021 at 22:10

I'll convert my comment to an answer, just so that the question has one. You can use MapAt to apply a function at a specific location in a nested list:
MapAt[DateObject, yourData, {All, 37}]

This will apply the DateObject function to the 37th column of your data set.