View previous topic :: View next topic
|
Author |
Message |
Hritam
New User
Joined: 27 Jun 2005 Posts: 36 Location: India
|
|
|
|
Hi,
We have a scenario here to get al records from a file having the previous line matched to a condition. here is an example.
Record Length = 250
Match condition position is 4 of length 8
I/P File Format
=============
TBH324567890
TAB6578123648924852305890
TAA6578123648924852305890
TAB6578123648924852305890
TAA6578123648924852305890
TBH235476253
TAB7612341378460357345684
TAA7612341378460357345684
TAB7249857350565865606956
TBH123456734
TAB7612341378460357345684
TAA7612341378460357345684
TAB7249857350565865606956
=============
Expected o/p file for TBH=324567890 and 123456734
==============
TAB6578123648924852305890
TAB6578123648924852305890
TAB7612341378460357345684
TAB7249857350565865606956
Please let me know if you have the solution for this requirement.
Also it would be helfull if you point out any topics which says to read next record based on the previous record in a file.
Thanks,
Ritam Dutta |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Ritam,
Your requirement is not clear.
Quote: |
Expected o/p file for TBH=324567890 and 123456734 |
This group of records seems to match your first condition:
TBH324567890
TAB6578123648924852305890
TAA6578123648924852305890
TAB6578123648924852305890
TAA6578123648924852305890
But what is the rule for getting these two records in the output file from this group of four records:
TAB6578123648924852305890
TAB6578123648924852305890
Likewise for the other group of records.
Do you only want records from the group that have 'TAB' in positions 1-3 or what?
Please explain the "rules" for getting from input to output more clearly.
Also, what is the maximum number of conditions you will want to match and where will these conditions be specified (hardcoded? in another file? some other way?). |
|
Back to top |
|
|
|