|
-
Jan 12th, 2010, 04:16 PM
#1
Thread Starter
New Member
[RESOLVED] Random Access Reading of a Non-Standard Text file
I hope someone can give me a little advice on how to proceed.
One of our customers is going to be sending me a flat file (ASCII-Text) that I have to break down and scan.
Every line ends in a CrLf - So I know I can use StreamReader and ReadLine(). I did get it to work on one of the test files they sent.(A very Short file) However, the file is not delimited at all and every field is padded to the full length they specified.
Here's the format of the file:
It consists of a header Line, some quantity of detail lines, and a Trailer line.
- Header-[1 Record only]9 Fields- 63 bytes including Crlf.
- Detail Lines[Highest record count up to 630,000 records](1 detail line is described) 60 Fields-1117 bytes Including crlf.
- Trailer - [1 Record only] 33 Fields - 395 bytes including crlf.
I figure I can just break the Header and Trailer lines with a Left, Mid, Right function for each field after I do a readline.
When I look at the Detail Line description and the quantity(OMG I hope they are exagerating) I wonder if I can somehow turn it into a random access ADODB file so that each field can be described in a structure.
The question I have is, How can I read the detail record starting from position 64 one record at a time, until I get to the beginning of the Trailer?
I know I can pull all the Detail Lines out with a MID(Detail,64,no_of_Rec*1117), but if there are as many records as they say, that's 700 Megs of records. I don't think that a string will hold that much.
Any help or insite that you can suggest will be deeply appreciated.
Thanks
FrankG
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|