Thanks for trying to resolve the issue. But I tested and the solution and it does not seem to work for me, I am wandering of I am doing something wrong. When I append the header does not write down. Strangely it worked once but then failed to work. I am pasting below my code:
for iClimateInventory in ClimateInventory
Data = CSV.File(ClimatePath_Input, header=true)
Year_Obs_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Year_Obs_Start))
Month_Obs_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Month_Obs_Start))
Day_Obs_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Day_Obs_Start))
Year_Obs_End = convert(Vector{Float64}, Tables.getcolumn(Data, :Year_Obs_End))
Month_Obs_End = convert(Vector{Float64}, Tables.getcolumn(Data, :Month_Obs_End))
Day_Obs_End = convert(Vector{Float64}, Tables.getcolumn(Data, :Day_Obs_End))
Year_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Year_Sim_Start))
Month_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Month_Sim_Start))
Day_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Day_Sim_Start))
Year_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Year_Sim_Start))
Month_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Month_Sim_Start))
Day_Sim_Start = convert(Vector{Float64}, Tables.getcolumn(Data, :Day_Sim_Start))
Hour_Start=[9]
Hour_Start_Sim=[9]
Hour_End =[9]
NEW_FILE(iClimateInventory, Year_Obs_Start, Year_Sim_Start, Year_Obs_End ,Month_Obs_Start, Month_Sim_Start ,Month_Obs_End, Day_Obs_Start ,Day_Sim_Start ,Day_Obs_End ,Hour_Start,Hour_Start_Sim ,Hour_End, i)
end
return nothing
end # function: JULES_CLIMATE
# ------------------------------------------------------------------
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# FUNCTION : NEW_FILE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function NEW_FILE(iClimateInventory, Year_Start, Year_Start_Sim, Year_End ,Month_Start, Month_Start_Sim ,Month_End, Day_Start ,Day_Start_Sim ,Day_End ,Hour_Start, Hour_Start_Sim ,Hour_End, i)
ClimatePath_Output = joinpath(raw"D:\DATAraw\JULES_DATA\DATE\DATE_SUMMARY.csv" )
Header = [ "Station", "Year_Start" ,"Year_Start_Sim", "Year_End" , "Month_Start" ,"Month_Start_Sim" ,"Month_End" ,"Day_Start", "Day_Start_Sim" ,"Day_End" ,"Hour_Start" ,"Hour_Start_Sim", "Hour_End"]
CSV.write(ClimatePath_Output, Tables.table([iClimateInventory Year_Start Year_Start_Sim Year_End Month_Start Month_Start_Sim Month_End Day_Start Day_Start_Sim Day_End Hour_Start Hour_Start_Sim Hour_End]), bom=true, append=true, writeheader = true,header=Header, delim = ",")
return nothing
end # function: NEW_FILE
# ------------------------------------------------------------------