I have a export file that contains data of fixed widths:
Name (6) Gender (6) Phone Number (12) - Includes a space
Data.txt
DanielMale (07654) 521254
Lisa Female(16545) 654456
Sarah Female(54656) 4896546
I need to extract the name and gender data including any spaces if the data doesn't fit the data width.
The brackets for the phone number need to be ignored. (How do you ignore items in regular expressions?
I currently have the following regular expression, that pulls out the people's names. I thought I could simply add the bit on the white to make it pull out the Genders, but this doesn't work. Where am I going wrong?
/(?<name>.{6}+) (?<gender>.{6}+)/
I need the data to look like this at the end.
^ = space
Daniel
Male^^
07654 521254
Lisa^^
Female
16545 654456
Sarah^
Female
54656 4896546