#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Data Import Question

I need to import data into Excel for statistical analysis. The data is being
collected from thousands of PC's in an organization. Each of them generates a
"log" file and places it on a server.

Each file is a text file, tab delimited with a header row, and a data row.
Each file imports perfectly into Excel.

What I would like to do, is concatenate the files into one file, then import
the entire file. I am able to do this by doing: "copy *.log concatenated.txt"
and it creates one file which imports fine.

The problem is that in this concatenated file, every other line is a repeat
of the column headers.

Is there an easy way in Excel to import that file and recognize every other
line as headers and reject them? I am using Excel 2007.

Thanks,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Data Import Question

Insert a temporary column to the left (ie Col A)and number the rows 1,2,3....
Sort with Col B so that headers will be together and then delete header rows
Sort them with ColA ie the sequence number..
Delete the temporary Col A

If this post helps click Yes
---------------
Jacob Skaria


"Steve Haack" wrote:

I need to import data into Excel for statistical analysis. The data is being
collected from thousands of PC's in an organization. Each of them generates a
"log" file and places it on a server.

Each file is a text file, tab delimited with a header row, and a data row.
Each file imports perfectly into Excel.

What I would like to do, is concatenate the files into one file, then import
the entire file. I am able to do this by doing: "copy *.log concatenated.txt"
and it creates one file which imports fine.

The problem is that in this concatenated file, every other line is a repeat
of the column headers.

Is there an easy way in Excel to import that file and recognize every other
line as headers and reject them? I am using Excel 2007.

Thanks,
Steve

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Data Import Question

You can use a helper column.

Enter 1 and 2 in top two cells.

Select both then right-click and drag down.

Release and "Copy Cells"

Autofilter for 1 and delete those visible cells found by the filter.

Or use a macro.

Sub delete_even_rows()
Dim r As Long
Dim rng As Range
Dim numLoops As Long
ActiveSheet.Rows("1:1").EntireRow.Insert
Set rng = Range(Cells(1), Cells(Rows.Count, ActiveCell.Column).End(xlUp))

numLoops = Int((rng.Rows.Count / 2))
For r = 1 To numLoops
rng(r + 1, 1).EntireRow.Delete
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 20 May 2009 11:00:01 -0700, Steve Haack
wrote:

I need to import data into Excel for statistical analysis. The data is being
collected from thousands of PC's in an organization. Each of them generates a
"log" file and places it on a server.

Each file is a text file, tab delimited with a header row, and a data row.
Each file imports perfectly into Excel.

What I would like to do, is concatenate the files into one file, then import
the entire file. I am able to do this by doing: "copy *.log concatenated.txt"
and it creates one file which imports fine.

The problem is that in this concatenated file, every other line is a repeat
of the column headers.

Is there an easy way in Excel to import that file and recognize every other
line as headers and reject them? I am using Excel 2007.

Thanks,
Steve


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
import XML data...Is there a size limit on the import? MatthewG Excel Discussion (Misc queries) 0 February 10th 09 05:57 PM
import question coconutt Excel Discussion (Misc queries) 1 August 21st 08 06:35 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
Excel 2007 Import data question Stevens Setting up and Configuration of Excel 0 December 11th 07 09:22 PM
Import Question metaltecks Excel Discussion (Misc queries) 4 November 22nd 06 07:46 PM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"