troubleshooting Question

Inner Loop Needed

Avatar of ghp7000
ghp7000 asked on
16 Comments1 Solution410 ViewsLast Modified:
Need an inner loop to process lines from a file that have the same account number abd I cant seem to make it work.
Here is the scenario:
a text file containing an ordered listing of names. I am using  while (fgets( filler, 115, FilePtr)) to read
each line of the file, with each line being no longer than 115 characters. I have no problem to read the lines and assign the read values to appropiate char or int type variables. I am also using atof to change some of the read values to double type numbers, so that they can be added as subtotals.
But what I want to do is to process a subset of the file, so that each time the account number changes, I can write the subtotals of each account number to a another file, and this is the part that I am hung up on. I have tried various if statements, while loops etc but I cant seem to get the right algorithm.
I still want to process the entire file, I just need a way to process each subset of data within the file.

Kent Olsen
Data Warehouse / Database Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros