How to swap the columns according to the data type? The sample data is as below (The data is fake, not real data):