Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Merging csv data

Posted on 2012-08-21
6
Medium Priority
?
571 Views
Last Modified: 2012-08-23
Hi

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.

Cheers

Ian
input1.CSV
input2.CSV
Ouput.csv
0
Comment
Question by:ian_greig
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

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

Author Comment

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

Expert Comment

by:als315
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.
ImportCSV.xlsm
0
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

by:ian_greig
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
Form.xlsx
0
 
LVL 40

Accepted Solution

by:
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
0
 

Author Closing Comment

by:ian_greig
ID: 38328099
thanks for the help
0

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