Learn how to a build a cloud-first strategyRegister Now


Merging csv data

Posted on 2012-08-21
Medium Priority
Last Modified: 2012-08-23

I would really appreciate some help on the following:

Have two instruments that we download data from as a csv files.
- Refer attached input1.csv and input2.csv

We would like to merge these files into one using a macro.
- Refer attached Output.csv

The issues:

On input files
- Do not need data in rows 1 to 6
- Column headings (row 7) vary slightly for example REL.PRESSURE (input1) and SYS-P(input2)
- Location of columns can vary
- We will need to upload multiple csv files of the two file types, ie more than 2 files will need to be uploaded and merge into Output.csv file

Output file
- Data to be sorted into the columns with titles appearing on row 1 (the REL.PRESSURE (input1) and SYS-P(input2) would go into the SYS-P column)
- Each input file should be added at end of the previous file inputted

Hope this enough information.


Question by:ian_greig
  • 3
  • 3
LVL 40

Expert Comment

ID: 38315723
Is it possible to use Access? Free runtime version will be enough if you don't need any changes in logic.

Author Comment

ID: 38318447
no sorry we don't have access
LVL 40

Expert Comment

ID: 38319403
Test sample (open VBA with Alt+F11 at first and add possible column names to array).
All csv files from in folder will be added to out file.
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.


Author Comment

ID: 38327966
Excuse the delayed response that is really good solution thanks.. it works very well

I'm going to accept your solution :) I just forgot to add more thing to do if its possible to include(copy) Out data into an excel form so we can then organise/filter the data

see attached file..  Form

basically would be great to run the macro from the form.xls and have the data copied into the Out worksheet
LVL 40

Accepted Solution

als315 earned 2000 total points
ID: 38328091
Sorry, due to EE rules, it should be new question.
You can use this answer and try modify code:
write to excel cells

Author Closing Comment

ID: 38328099
thanks for the help

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question