Something similar to this?
Code: (Select All)
Sub LoadFromTxt (txt_file$, names_list$())
''load a list of file names from a txt file
Dim fp&: fp& = FreeFile
Dim tmp$
Dim count&
Open txt_file$ For Input As fp&
While Not EOF(fp&)
Line Input #fp&, tmp$
tmp$ = Right$(_Trim$(tmp$), 4)
If Len(tmp$) = 4 Then
If InStr(".png.bmp.jpg.tga.psd.gif.hdr.pic.pnm.pcx.svg.ico.cur.qoi", tmp$) Then
count& = count& + 1
names_list$(count&) = tmp$
Else
Print "Unknown file type " + tmp$
End If
End If
Wend
Close #fp&
End Sub