Solved

import csv to excel macro

Posted on 2014-01-14
6
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

752 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