Something like this should work:
Names Default To Here(1);
path = "C:\WIP\All text files\"; //note ending \
fileList = Files In Directory(path);
//use first table as "base datatable" to concatenate to
dt = Open(
path || fileList[1],
columns(
New Column("c000001", Numeric, "Continuous", Format("Best", 12)),
New Column("c000002", Numeric, "Continuous", Format("Best", 12)),
New Column("c000003", Numeric, "Continuous", Format("Best", 12)),
New Column("c000004", Character, "Nominal"),
New Column("c000005", Character, "Nominal")
),
Import Settings(
End Of Line(CRLF, CR, LF),
End Of Field(Comma, 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(0),
Column Names Start(1),
Data Starts(1),
Lines To Read("All"),
Year Rule("20xx")
)
);
//start from 2 because we already have file 1 as dt
For(i = 2, i <= N items(fileList), i++,
dt_temp = Open(
path || fileList[i],
columns(
New Column("c000001", Numeric, "Continuous", Format("Best", 12)),
New Column("c000002", Numeric, "Continuous", Format("Best", 12)),
New Column("c000003", Numeric, "Continuous", Format("Best", 12)),
New Column("c000004", Character, "Nominal"),
New Column("c000005", Character, "Nominal")
),
Import Settings(
End Of Line(CRLF, CR, LF),
End Of Field(Comma, 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(0),
Column Names Start(1),
Data Starts(1),
Lines To Read("All"),
Year Rule("20xx")
)
);
dt << Concatenate(dt_temp, Append to first table);
Close(dt_temp, no save);
);
-Jarmo