Author: vnktrrd
Subject: How to split the records using the amount field
Posted: Fri Oct 28, 2016 7:33 pm (GMT 5.5)
Hi,
I have an amount field in a file and I want to split the records into multiple records 250000 each into one file until the total number of records reaches 10. Even after 10 splits if the amount is greater than zero then write the record into a separate file with the remaining amount.
For ex input file has below data.
And I want the output file-1 like this
Output file-2 like this
Output file-2 should only be written when the amount field has value greater than zero even after 10 splits.
Please advise.
Thanks,
Ramana.
Code'd correctly
Subject: How to split the records using the amount field
Posted: Fri Oct 28, 2016 7:33 pm (GMT 5.5)
Hi,
I have an amount field in a file and I want to split the records into multiple records 250000 each into one file until the total number of records reaches 10. Even after 10 splits if the amount is greater than zero then write the record into a separate file with the remaining amount.
For ex input file has below data.
Code: |
12345 2550000 |
And I want the output file-1 like this
Code: |
12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 12345 250000 |
Output file-2 like this
Code: |
50000 |
Output file-2 should only be written when the amount field has value greater than zero even after 10 splits.
Please advise.
Thanks,
Ramana.
Code'd correctly