Hey,
You can use getmetadata activity to identify the structure of header and the column count in the txt files.
Based on the column count, you can create seperate copy activity via IF activity/Switch activity.
One can also leverage a single copy activity and create dynamic mappings at run time based on column count:
https://sqlitybi.com/dynamically-set-copy-activity-mappings-in-azure-data-factory-v2/
Similar thread : https://stackoverflow.com/questions/68800592/adf-if-condition-count-source-columns/68800648#68800648