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.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28