Page 1 of 1

Merging and Sorting segmented, delimited files

Posted: Thu Oct 01, 2009 2:09 pm
by acavarra
I have numerous segmented files that share a common key but beyond that are defined differently.

How can I merge these files and sort on the common key in the process.

Any help would be greatly appreciated.

Posted: Thu Oct 01, 2009 2:12 pm
by chulett
Can you post some examples of the actual file contents and then what this merged and sorted output should look like for the sample data? I think that would go a long way towards helping us help you properly.

Posted: Thu Oct 01, 2009 2:23 pm
by acavarra
Do you want to see layout examples or actual data?

Posted: Thu Oct 01, 2009 2:33 pm
by acavarra
Let me know if you need more...

I have multiple files that contain a different set of data for claims processing. The files are:

Claims
Pharmacy
Prescriber
Patient
Insurance
etc...

The first 86 characters are the key they have in common...

Client, Group, Plan, Patient, Health Service ID, Health Service Item No, Record ID

followed by various columns of random data that pertain to that segment.

I need to sort all these files together by this key. The columns/data will not be modified at all. Im having problems because the files do not contain the same metadata.

Posted: Thu Oct 01, 2009 2:46 pm
by chulett
OK, that helps somewhat. So, what is the ultimate goal here? The creation of a single file with all of this combined, sorted by the common key and all of the variable record metadata (and record lengths) preserved?

Key1
Claims data for Key1
Pharmacy data for Key1
Prescriber data for Key1
Patient data for Key1
Insurance data for Key1
etc...
Key2
Claims data for Key2
Pharmacy data for Key2
Prescriber data for Key2
Patient data for Key2
Insurance data for Key2
etc...

:?:

Posted: Thu Oct 01, 2009 3:00 pm
by acavarra
Exactly...for this pass!

Ultimately, I will be creating headers/footers using the key data to break on.