rycher has asked for the wisdom of the Perl Monks concerning the following question:
I have one file containing employee data that has been populated by different MySQL exported table files from one database.
How would I sort the data in this merged file to group together all relevant?
For example(the three dots signify x# of spaces between entries):
Infile: ---------------- employee_id: 227 position_id: 182 departmentNumber: 38 id: 67 manager: 222 ... uid: SimpsonH employee_id: 227 sn: Simpson givenName: Homer ... extension: 5555 employee_id: 227 telephonenumber: 218 344 fax: 0 phone_id: 652 ... position_id: 182 title: Nuclear Plant Operator ... uid: BurnsM employee_id: 222 sn: Burns givenName: Montgomery Burns ... name: Nuclear Resources departmentNumber: 38 buildingName: 2 ... buildingName: 2 name: Radioactive Hall ... buildingName: 2 roomNumber: 7 location_id: 6 ... roomNumber: 7 room: ControlTower Outfile: --------------------- uid: simpsonh sn: Simpson givenName: Homer manager: burnsm telephoneNumber: 2183445555 departmentNumber: 38 title: Nuclear Plant Operator roomNumber: 7 buildingName: Nuclear Resources
I am not even sure where to start at this point. There is a pattern with the *_id categories that I could key in on and yank the following line but I'm unsure on how to go about doing that... please help!
Sincerely,
rycher
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Open file, sort data on matching field, close file
by mr_mischief (Monsignor) on Apr 29, 2009 at 20:00 UTC | |
|
Re: Open file, sort data on matching field, close file
by apl (Monsignor) on Apr 29, 2009 at 18:55 UTC | |
|
Re: Open file, sort data on matching field, close file
by Plankton (Vicar) on Apr 29, 2009 at 20:05 UTC | |
by rycher (Acolyte) on May 01, 2009 at 01:55 UTC | |
|
Re: Open file, sort data on matching field, close file
by punch_card_don (Curate) on Apr 30, 2009 at 12:27 UTC | |
|
Re: Open file, sort data on matching field, close file
by CountZero (Bishop) on Apr 30, 2009 at 15:41 UTC |