Merge two for loop of different file types to one