Solved

import csv to excel macro

Posted on 2014-01-14
6
460 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
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 use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now