Custom mapping for CSV import (without VBA?)

SimSum

New Member
Joined
Dec 3, 2021
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
I have headers within a CVS import that have 3 attributes.

1. Some times they are present, sometimes not
2. When they are present, they are always spelled the same
3. When they are present, they can and do appear anywhere in the header order.

So let's say my CSV file, first row looks like this:

Code:
Header1,Header2,Header5,Header7,Header6,Header9
data,data,data,data,data,data

So my first goal would be to import that so that the headers line up in proper order (mapping and ignoring gaps)
In Excel:


Code:
Excel1    Excel2    Excel5    Excel6    Excel7    Excel9
data      data      data      data      data      data

The pre-defined sheet it's going into has different header spellings, but they are always in the same column order. That spelling CAN change if it's necessary to absolutely match the CSV header spellings?
And this would be good to here. But if we can...

The Excel sheet would have all of the missing gap categories that weren't in this particular import, but do appear in others. So we would need blank/empty data for those gap columns missing in this import.

Code:
Excel1    Excel2   Excel3   Excel4   Excel5    Excel6    Excel7   Excel8    Excel9
data      data                       data      data      data               data

I completely understand it's challenging to create missing data, even if it's empty data, so if I can just accomplish goal 1, lining up the columns, I can merge the data into earlier imports by hand.

Thank you for any help!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If the headers in result worksheet are exactly the same as the text file so an easy way is to use the easy Excel basics advanced filter without criteria …​
 
Upvote 0
If the headers in result worksheet are exactly the same as the text file so an easy way is to use the easy Excel basics advanced filter without criteria …​
I'm sorry. I have absolutely no idea how to implement your suggestion?
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,830
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top