I have situation where I need to remove voucher records if a voucher is created then voided with in the same file.
I will need both of them removed because they cancel each other out with in the same file.
Data example:
001PVB00011/04/2004 RECP100Item1 +000000010.0000Eac+00003000.00INV300098765 Z100038 SPCA11/04/2004
001PVB00011/04/2004 RECP900paper2 +000000010.0000Rol+00001500.00INV3000789 Z100054 SPCA11/04/2004
001PVB00011/04/2004 RECP900paper2 +000000010.0000Rol+00001000.00INV3000789 Z100054cSPCA11/04/2004
001PVB00011/04/2004 RECP987timber +000000100.0000Eac+00001200.00INV0054 Z100054 SPCA11/04/2004
001PVB00011/05/2004 RECP120TEST +000000010.0000Eac+00000300.00INV345678 Z100038 SPCA11/05/2004
001PVB00011/05/2004 RECP983test2 +000000010.0000Eac+00000300.00INV345678 Z100038 SPCA11/05/2004
The key is from position 1 to 51
The cancel voucher flag is at position 108
Notice the record with the C in position 108 and the record before it will need to be removed.
This is just one example of the key being duplicated, there could be more then two records duplicated with in a given file.
Is there a way to do this in unix?
Unfortunately the columns in the data are not lining up in on the web, but hopefully you understand what I am after.
Thank you for all your help
Tom
I will need both of them removed because they cancel each other out with in the same file.
Data example:
001PVB00011/04/2004 RECP100Item1 +000000010.0000Eac+00003000.00INV300098765 Z100038 SPCA11/04/2004
001PVB00011/04/2004 RECP900paper2 +000000010.0000Rol+00001500.00INV3000789 Z100054 SPCA11/04/2004
001PVB00011/04/2004 RECP900paper2 +000000010.0000Rol+00001000.00INV3000789 Z100054cSPCA11/04/2004
001PVB00011/04/2004 RECP987timber +000000100.0000Eac+00001200.00INV0054 Z100054 SPCA11/04/2004
001PVB00011/05/2004 RECP120TEST +000000010.0000Eac+00000300.00INV345678 Z100038 SPCA11/05/2004
001PVB00011/05/2004 RECP983test2 +000000010.0000Eac+00000300.00INV345678 Z100038 SPCA11/05/2004
The key is from position 1 to 51
The cancel voucher flag is at position 108
Notice the record with the C in position 108 and the record before it will need to be removed.
This is just one example of the key being duplicated, there could be more then two records duplicated with in a given file.
Is there a way to do this in unix?
Unfortunately the columns in the data are not lining up in on the web, but hopefully you understand what I am after.
Thank you for all your help
Tom