You need couple of things for this: Loop (for-loop), way to build the url (eval insert), way to load data from the url (Open with correct arguments) and way to combine the data (concatenate).
Names Default To Here(1);
//We can use Eval Insert to replace ^temp_year^ in the string
dl_url = "http://www.arpalazio.net/main/aria/sci/basedati/chimici/BDchimici/RM/MedieGiornaliere/RM_PM2.5_^temp_year^_gg.txt";
dt = New Table(); //table to collect results
//for-loop
For(i = 1990, i <= 2021, i++,
temp_year= Char(i);
year_url = Eval Insert(dl_url);
//downloaded first one file by hand -> opened in JMP to get Open with correct parameters and replaced file path with URL
Try(
dt_temp = Open(
year_url,
Import Settings(
End Of Line(CRLF, CR, LF),
End Of Field(Spaces, Space, CSV(0)),
Strip Quotes(1),
Use Apostrophe as Quotation Mark(0),
Use Regional Settings(0),
Scan Whole File(1),
Treat empty columns as numeric(0),
CompressNumericColumns(0),
CompressCharacterColumns(0),
CompressAllowListCheck(0),
Labels(1),
Column Names Start(1),
Data Starts(2),
Lines To Read("All"),
Year Rule("20xx")
)
);
dt << Concatenate(dt_temp, Append to first table(1));
Close(dt_temp, no save);
,
Show(exception_msg)
);
);
Concatenate should be able to handle columns which are missing by creating missing values and Try is fairly easy way to handle URLs which don't exist (a bit lazy tho).
-Jarmo