Simplify csv import export workflow

Copper Contributor

I'd like to simplify the workflow to importing data from a service I subscribe to into my database. I've been employing the following steps. 

 

The first step is exporting data from my source. When I Export this data it creates an excel csv file which downloads onto my Mac. Let's call this sheet the "export file". 

 

The second step is to upload it to my database using a different CSV file. We'll call this the "import file". 

 

With the intent to eliminate repetition, I decided to create a standard non-csv excel file that has contains 2 tabs. (Let's call it the "non-csv file")  The first tab has a copy of the export column arrangement. The second tab has a copy of the import column arrangement. 

 

I only import a fraction of the data from the export file (name, address, phone, etc). 

 

To automate the process and have data populate onto the correct columns of the import tab, I utilize a formula. For example,  if I'm going to import the First Name, Last Name and Address and all three are on ABC columns respectively. I would place the following equations on the corresponding columns of the import tab. 

 

Import Row 2 Name Column = export!A2 

Import Row 2 Last Name Column = export!B2

Import Row 2 Address Column = export!B2

 

Once the data is in place, I copy the rows that has the data and paste it special on the import CSV file and upload to my database. 

 

This works on the first import. However, When I clear the prior data and paste the new batch of data, It appears that the reference equations aren't doing their job because the column and row data has changed on the equation to generic column and row info. 

 

If I'm doing it wrong, Is there another way to accomplish the same thing?

 

I hope I was able to make sense in my description of the problem.  Otherwise. feel free to reach out. 

7 Replies
Hello,
For this kind of tasks it is better to use power query. You set up the system once and then the whole procedure becomes automatic. You can also set the query to get the last file in a directory so that whenever you copy the new .csv file, the query will automatically takes it and updates all the data. The only thing you need to do would be usins save as dialog.

Thanks @erol sinan zorlu

Can you suggest a source that provides instructions on how to achieve that?

For a basic study you can get M for Data Monkey book. For advanced applications it is up to you.

@A_Castro1625 Since you indicated that you work on a Mac, you may forget about using Power Query.

@A_Castro1625 

Afraid that won't work on Excel for Mac, Power Query has quite limited functionality for it.

Thanks. Glad you told me that before I invested the time into it.
Thanks