Help for this page

Select Code to Download


  1. or download this
    
    perl -lanF", " -e "print join(',',map{$1if/(?:[Name|Age|Gender] = )(.+
    +)/}@F) if shift @F eq 'Person1'" persons.txt
    
    Lydia,20,F
    
  2. or download this
    
    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