# Get the list of files and iterate through each file
file_list = pynebv.file.list()
for file in file_list :
    print("Input file : " + file.file_path)

    # Iterate through all descendants in the file
    for top_cell in file.descendants():
        if not isinstance(top_cell, pynebv.TopCell):
            continue

        # Output the top cell name, layer numbers, and cell area size
        print("MAIN   " + top_cell.name)
        layers = [str(layer.name.replace(" ", "").replace("L", "")) for layer in top_cell.layers()]
        print("LAYNO  " + ", ".join(layers))
        print("SIZE   " + ", ".join(map(str, top_cell.area)))
