LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Remove lines from text file prior to importing in Excel

I've scoured the usual sources, but haven't found any existing code
that will accomplish what I need, so here's my situation.

I've got a large text file from my company's mainframe. It's around
120,000 lines, with each record from a particular database taking up
several lines (generally 8 to 16). Of those lines, only 4 of them are
needed for the output file I need to produce. Since there is an
import limit on Excel 2003, I'd like to remove the extraneous lines
prior to the actual opening of the file in Excel. It should be pretty
easy to isolate which lines to delete:

Example data:

RECORD1 11 DATA-01 DATA-25 DATA-49
RECORD1 14 DATA-02 DATA-26 DATA-50
RECORD1 17 DATA-03 DATA-27 DATA-51
RECORD1 20 DATA-04 DATA-28 DATA-52
RECORD1 31 DATA-05 DATA-29 DATA-53
RECORD1 34 DATA-06 DATA-30 DATA-54
RECORD1 37 DATA-07 DATA-31 DATA-55
RECORD1 40 DATA-08 DATA-32 DATA-56
RECORD2 11 DATA-09 DATA-33 DATA-57
RECORD2 14 DATA-10 DATA-34 DATA-58
RECORD2 17 DATA-11 DATA-35 DATA-59
RECORD2 20 DATA-12 DATA-36 DATA-60
RECORD2 31 DATA-13 DATA-37 DATA-61
RECORD2 34 DATA-14 DATA-38 DATA-62
RECORD2 37 DATA-15 DATA-39 DATA-63
RECORD2 40 DATA-16 DATA-40 DATA-64
RECORD3 11 DATA-17 DATA-41 DATA-65
RECORD3 14 DATA-18 DATA-42 DATA-66
RECORD3 17 DATA-19 DATA-43 DATA-67
RECORD3 20 DATA-20 DATA-44 DATA-68
RECORD3 31 DATA-21 DATA-45 DATA-69
RECORD3 34 DATA-22 DATA-46 DATA-70
RECORD3 37 DATA-23 DATA-47 DATA-71
RECORD3 40 DATA-24 DATA-48 DATA-72

Basically, the 9th and 10th characters of a row would determine
whether or not I keep the line or delete them.

I know how to do this in VBA (Basically a match using If
Mid(Cells(currow, 1), 9, 2) < "[Value to Match]" And etc...), but I
can't figure out how to manipulate the text prior to importing to
avoid that 65,000 row limit.

Any help would be appreciated.

Thanks!
 
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
Modify The Code For Importing Text File into an Excel File vicky Excel Programming 1 December 28th 09 09:47 AM
How do I remove lines through text in excel cbroock Excel Discussion (Misc queries) 1 March 6th 08 06:44 PM
Importing Text Files of 100,000+ lines, many blanks Pflugs Excel Programming 8 June 30th 06 06:39 PM
Importing data from a Text File, Not enough lines? baldyguy Excel Programming 1 June 1st 04 05:00 PM
Importing Multiple lines of text in a single Excel Cel filmfatale Excel Programming 1 December 8th 03 08:33 PM


All times are GMT +1. The time now is 10:46 PM.

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"