Hi,
Is there any way for your script to write the text file like this?
user1|johnson | number of parts1| 5 | number of parts2 | 10
user2 | andy | number of parts1 | 10 |number of parts2 | 10
The reason I am asking is that the script would read it line by line. If we can set it up just like above. It would be very easy for you to calculate, because php will read those items as an array. Something like this
[user] =>array
[0] => user1
[1] => johnson
[2] => number of parts1
[3] => 5
[4] => number of parts2
[5] => 10
[user] => array
[0] => user2
[1] => andy
[2] => number of parts1
[3] => 10
[4] => number of parts2
[5] => 10
So, with that arrangement on the flat file, we can easily explode the |, and then we can loop through the lines using for loop. That should give us a difinitive values on every items
For example if want to calculate on the total of parts1 and parts2 for the first user, it will be just as simple as $user[3] + $user[5];
Let me know if you are willing to change the formatting of your text file, so that I can help you..