Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
Posted: Thu Jan 15, 2004 4:17 am Post subject: Merging two sorted files when one may be corrupted
This relates to updating coded based on line numbers and delta card. Though both the files should have unique file number but sometime the original code has errors.
Input File ORIGINAL, corrupted with non unique line number
Code:
000100 Hi
000200 I
000300 Dibakar
000200 Biswas.
000400 Who
000500 are
000600 you
000600 ?
Input File DELTA, correct delta code, no repitition.
Code:
000200 I'm
000400 How
Output File MERGED. First 000200 line got updated, other one is unchanged. Line 00400 is updated.
Code:
000100 Hi
000200 I'm
000300 Dibakar
000200 Biswas.
000400 How
000500 are
000600 you
000600 ?
This gives me NEWCODE, which is not same as the required MERGED if ORIGINAL file has duplicates. Here first 00200 line got updated while the next one got deleted, and so is the second 000600 line.
Code:
000100 Hi
000200 I'm
000300 Dibakar
000400 How
000500 are
000600 you
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
Posted: Thu Jan 29, 2004 3:32 am Post subject:
Coolman,
I have an old sysncsort so couldn't try out your code. Moreover it was decided that in such cases we will correct the corrupt file. So, my requirement has gone too.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum