Hi,
I have a sample R script. While the output is correct, FME is logging incorrect information.
The Code:
library(sf)
shp_path <- Output$shapefile_path
if (is.null(shp_path) || shp_path == "") {
stop("location empty or no exists.")
}
shp_path <- normalizePath(shp_path, winslash = "/")
if (!file.exists(shp_path)) {
stop("location not found: ", shp_path)
}
print(paste("read shapefile:", shp_path))
shape_data <- st_read(shp_path)
if (is.null(shape_data)) {
stop("Error in shapefile:", shp_path)
}
shape_data$ano <- 2025
output_path <- shp_path
print(paste("Writing:", output_path))
st_write(shape_data, output_path, delete_layer = TRUE)
print("Success.")
Log below:
Error in utils::read.table(value, sep = sep, header = header, skip = skip, :
no lines available in input
Calls: dbWriteTable -> dbWriteTable -> .local -> <Anonymous>
In addition: Warning message:
In file(file, "rt") :
file("") only supports open = "w+" and open = "w+b": using the former
Execution halted
Failed to execute scripted code
Thank´s