Hi forum members. It has been several years since my last post. Currently I am using fairly large datasets on a day to day basis for handling immigration cases at a law firm. Our Input file is filled out by our secretary staff. The first column is the case ID-sample ID then the second column is the sample ID, third is the relationship status and the fourth is the name.
What I need is a output file where the father (or mother) is compared to the child (daughter or son) so that the output file would be in rows with a specific syntax (please see the output file).
The file is tab seperated
- Father and mother would be compared to all children (child, son and daughter)
- If it is a son then a M would be used (e.g. ...[Jim Smith][M])
- If it is a daughter then a F would be used (e.g.....[Jane Smith][F])
- If the name is a child in the third column then it would be left blank (e.g..... [Randy Davis][])
- Sometimes the list can have more than one child (e.g. up to 8 children) so then the father would have to be compared to all children in the output format.
Input file
USIM1357-11A 11A Father Jim Smith
USIM1357-11B 11B Mother Jane Smith
USIM1357-11C 11C Son Jack Smith
V106866-12A 12A Father Ralph Davis
V106866-12B 12B Child Randy Davis
V106864-14A 14A Mother Jane Jones
V106864-14B 14B Son Jim Jones
V106879-15A 15A Father Andre Busby
V106879-15B 15B Daugther Jenny Busby
V106611-2A 2A Father Kyle Mike
V106611-2B 2B Son Evan Mike
V106611-2C 2C Son Bob Mike
V106611-2D 2D Daughter Jane Mike
Output file
USIM1357-11A11C_[Jim Smith][M] - [Jack Smith][M]
USIM1357-11B11C_[Jane Smith][F] - [Jack Smith][M]
V106866-12A12B_[Ralph Davis][M] - [Randy Davis][]
V106864-14A14B_[Jane Jones][F] - [Jim Jones][M]
V106879-15A15B_[Andre Busby][M] - [Jenny Busby][F]
V106611-2A2B_[Kyle Mike][M] - [Evan Mike][M]
V106611-2A2C_[Kyle Mike][M] - [Bob Mike][M]
V106611-2A2D_[Kyle Mike][M] - [Jane Mike][F]
Above is the output file. It would be best if the script is in perl however any code would help.
THanks