Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Thanked 0 Times in 0 Posts

    CSV processing: rearranging 3 master rosters into 12 separate ones

    I was asked to do some volunteer coding for a youth sports organization I've participated in.

    Basically, there are three rosters in CSV format: a player roster, a "mother" roster, and a "father" roster. Each one has columns for first name, last name, address, various contact information, etc. The player roster includes a column for grade, and the parent rosters include columns for each of their children's names.

    I'm supposed to create individual rosters for each grade. The new rosters have a similar, but slightly different and simplified series of columns. Each new roster has to include a row for every player in the grade, plus a row for each student's mother and father.

    I'm guessing that the program should probably cycle through every row of the player roster, find the student's first and last name, then go through the parent rosters and find the parents that match the first and last name. It should then identify, aggregate, and rearrange all the information attached to those entries (player, mother, father) into three new rows, and append them to the appropriate new grade roster. Or maybe each grade would be isolated and done separately.

    I'm just not sure how to accomplish this. I've done form processing in PHP before, but I don't know how I can use that skill in this context. I'm at a loss and I could really use some advice. Does anyone have any suggestions?

  2. #2
    Supreme Master coder!
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,168 Times in 1,159 Posts
    Show us a few lines from each CSV file.

    Then, show a few lines of how the final CSV should look for one of the 12 grades.

    And finally ...
    Are the CSV files coming from an Excel sheet? And if so, why not use Excel?



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts