Help for this page
perl -lanF", " -e "print join(',',map{$1if/(?:[Name|Age|Gender] = )(.+ +)/}@F) if shift @F eq 'Person1'" persons.txt Lydia,20,F
perl -lanF", " -e "BEGIN{map{$_=pop @ARGV}$rx,$who}print join(',',map{ +$1 if /(?:[$rx] = )(.+)/}@F) if shift @F eq $who" persons.txt Person1 + "Name|Age|Gender" Lydia,20,F