Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a text file that contains multiple records, each record is 1288 bytes in length. Each record is uniquely identified with a special 5 byte code @647.

I am pulling info from different fields in each record, but now I must separate results by the GROUP of records indicated by what's @647.

i.e.:
20120614  12345 Joe Somebody             ...@647 = 1234500000
20120614  65497 Joe's Sister             ...@647 = 1234500000
20120614  89845 Alan Somebody            ...@647 = 5432100000
20120614  56498 Alan's Sister            ...@647 = 5432100000


I want to pull and group all the 12345 records in one place and then group all the 54321 records in another place.

How to I do that in vb6?
Posted
Updated 14-Jun-12 21:00pm
v2
Comments
Sergey Alexandrovich Kryukov 14-Jun-12 18:51pm    
What's the problem, actually. And how come you end up with such files? Why would you or somebody create them in first place?
--SA

1 solution

The first thing I'd be inclined to do in situations like this is parse the incoming records into something more useful, xml, if there aren't going to be too many of them, or Access or SQL

That way, you can search/seek over them much easier

Parse them with a RegEx[^], for example, then create an xml doc say ..

XML
<file>
<record num="20120614"" serial="12345" name="Joe Somebody" special="@647" other="12345000" />
...
...
</file>


Then you can use XML and XMLPath[^] to search

In this instance it would be something like \\record[@special='@647']

Just noticed you're using VB6, so those two links are this[^], and this[^], respectively
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900