Combining multiple records
Posted: Thu Feb 05, 2015 4:21 am
I'm trying to figure out a way with Syncsort to combine some data from multiple records. I've searched and I can find some solutions, but I can't find one that will seem to work with my situation.
The input file looks like this:
And I need the output file to look like this.
The filename field in this file can continue on several lines and this where I have the issues. The first 8 character name column can repeat many times and is not unique and neither are the files names so there is no unique key. I was hoping to do what I need with a quick and dirty sort rather than having to write a program.
Thanks in advance for any replies.
The input file looks like this:
----+----1----+----2----+----3----+
NAME1111 ####### FILENAME.GOES.HE
RE_AND_CONTINUES
_DOWN_HERE_AND_K
EEPS_GOING.TXT
NAME2222 ####### NEXT_FILE.TXT
NAME2222 ####### ANOTHER_FILE_YET
_AGAIN.TXT
NAME3333 ####### THIRD_FILE_NAME_
TWO_LINES.TXT
NAME1111 ####### FILENAME.GOES.HE
RE_AND_CONTINUES
_DOWN_HERE_AND_K
EEPS_GOING.TXT
NAME2222 ####### NEXT_FILE.TXT
NAME2222 ####### ANOTHER_FILE_YET
_AGAIN.TXT
NAME3333 ####### THIRD_FILE_NAME_
TWO_LINES.TXT
And I need the output file to look like this.
NAME1111 FILENAME.GOES.HERE_AND_CONTINUES_DOWN_HERE_AND_KEEPS_GOING.TXT
NAME2222 NEXT_FILE.TXT
NAME2222 ANOTHER_FILE_YET_AGAIN.TXT
NAME3333 THIRD_FILE_NAME_TWO_LINES.TXT
NAME2222 NEXT_FILE.TXT
NAME2222 ANOTHER_FILE_YET_AGAIN.TXT
NAME3333 THIRD_FILE_NAME_TWO_LINES.TXT
The filename field in this file can continue on several lines and this where I have the issues. The first 8 character name column can repeat many times and is not unique and neither are the files names so there is no unique key. I was hoping to do what I need with a quick and dirty sort rather than having to write a program.
Thanks in advance for any replies.