Mar-12-2020, 06:47 PM
I have a file that contains only x's and 2's. I want to change the x's to either 1 or 2 and the sum of 1's in the new file must be exactly 10000. The total number of x in the current file is 87505.
Any tips on how this is done?
Here's a portion of the said file:
Any tips on how this is done?
Here's a portion of the said file:
1 2 3 4 5 6 7 8 |
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 x x x x x x x x x x x 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 x x x x x x x x x x x 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 x x x x x x x x x x x 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 x x x x x x x x x x x 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 |