Here's an approach that uses base R. First we need to create some data that resembles your description:
# Create dummy data - three files with 5 observations in each
set.seed(2)
dta <- data.frame(lat=sample(4, 15, replace=TRUE),
lon=sample(4, 15, replace=TRUE), sm=sample(100, 15))
write.csv(dta[1:5, ], file="file01.csv", row.names=FALSE)
write.csv(dta[6:10, ], file="file02.csv", row.names=FALSE)
write.csv(dta[11:15, ], file="file03.csv", row.names=FALSE)
Now we read the files into a list, convert the list to a data frame, and extract the sm values matching a criterion:
# Read files and extract values
fls <- paste0("file0", 1:3, ".csv")
fls.lst <- lapply(fls, read.csv)
names(fls.lst) <- fls
all <- do.call(rbind, fls.lst)
vals <- all[all$lat==1 & all$lon==3, ]
write.csv(vals, file="sm_values.csv")
read.csv("sm_values.csv")
# X lat lon sm
# 1 file01.csv.1 1 3 43
# 2 file02.csv.2 1 3 6
# 3 file02.csv.3 1 3 83
You should read the manual pages for each of these functions to see what they are doing.