Solved

import csv to excel macro

Posted on 2014-01-14
6
480 Views
Last Modified: 2014-01-25
Hi,

I have a csv file that has been exported from a storage controller and the format is like this.  

line1
line2
line3
line4
line5
date, item1
value, value
value, value
line7
line8
line9
line10
line11
date, item2
value, value
value, value
value, value
value, value

I would like to read the data after line 5 and 11 into a excel spreadsheet.  Can it be done using a macro ?

so the fields i would have would be

date, item1, date, item2
0
Comment
Question by:cmatchett
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:gplana
ID: 39779835
Why don't just edit the .csv on a text editor (like notepad) and remove these lines?
Then you can import the .csv as a text file, selecting the comma as the separator character.

Hope it helps.
0
 

Author Comment

by:cmatchett
ID: 39779883
The data would go into the spreadsheet in two continuous columns then?

I would like 4 columns

date, item1, date, item2
0
 
LVL 15

Expert Comment

by:gplana
ID: 39779905
No, data will go on different rows.

However, once you have the pairs on different rows, you can manipulate the worksheet to combine two rows in one row.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 16

Expert Comment

by:Gerald Connolly
ID: 39784809
Just import the whole file into one sheet and just extract the data you want into another using standard Excel cross sheet referencing.
0
 

Accepted Solution

by:
cmatchett earned 0 total points
ID: 39794036
I ended up using access.
0
 

Author Closing Comment

by:cmatchett
ID: 39808402
excel didn't get me the result i wanted
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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.

773 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