From: Dobrica Pavlinusic Date: Thu, 17 Jun 2010 16:46:26 +0000 (+0200) Subject: Merge branch 'eval-code' X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=eb568d13d559520dec2a025dcbe23a1dcf003745;hp=-c;p=MojoFacets.git Merge branch 'eval-code' --- eb568d13d559520dec2a025dcbe23a1dcf003745 diff --combined README index 1d55870,98e7ad1..a8f26d5 --- a/README +++ b/README @@@ -44,24 -44,17 +44,24 @@@ any other dataset which has same uniqu Modify your data using perl snippets - Experimental REPL console supports perl snippets which get $rec hash which is one + Experimental REPL console supports perl snippets which get $row hash which is one element from your dataset. All values are repetable, so you always have to create array of values if you are creating new columns, even for single value. * generate new columns with number of elements in some other column - $rec->{count} = [ $#{ $rec->{original} } + 1 ]; + $row->{count} = [ $#{ $row->{original} } + 1 ]; * generate century column from year - foreach my $year ( @{ $rec->{Year} } ) { - push @{ $rec->{century} }, int($year/100)+1; + foreach my $year ( @{ $row->{Year} } ) { + push @{ $row->{century} }, int($year/100)+1; } +* modify existing column + + foreach ( @{ $rec->{'Cited Author'} } ) { + s/^\.+//; + $_ = uc $_; # assigment is needed to modify value! + } +