There are several way to input from/output to files in GDL. You should check the GDL Reference Guide. You can work with TXT files, "Data Files" (you define the format in the file, but basically a text file), XML files.
After you input that data you can work with array and I guess you can narrow down the array into another array that contains only those items that fulfill your criteria.
....................................................................................................
Get Archicad Tips at https://twitter.com/laszlonagy
AMD Ryzen 1700X CPU, 48 GB RAM, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), WIN10 PRO ENG, AC20-AC26
Loving Archicad since 1995