lcCreate = [CREATE CURSOR crsImport (Fld1 C(20)] FOR lnFor = 2 TO 19 lcCreate = lcCreate + [, Fld]+TRANSFORM(lnFor)+[ C(20)] NEXT lcCreate = lcCreate + [)] &lcCreate lcDirForImport = GETDIR(,,,64) IF NOT EMPTY(lcDirForImport) lnFiles = ADIR(laFiles,ADDBS(lcDirForImport)+[*.001]) FOR lnFor = 1 TO lnFiles lcFileToImport = ADDBS(lcDirForImport)+laFiles[lnFor,1] SELECT crsImport APPEND FROM (lcFileToImport) DELIMITED RENAME (lcFileToImport) TO FORCEEXT(lcFileToImport,[TRN]) NEXT ENDIF SELECT crsImport SCAN IF ALLTRIM(Fld1) == [01] *** Manage header record *** with proper transformation of the types *** between C(20) and the real Header table type ELSE *** Manage detail records *** with proper transformation of the types *** between C(20) and the real Detail table type ENDIF ENDSCAN