Relation:Tutorial 7

Extend

No the fun begins. We can create new values from the existing columns. Extend creates a new column based on an expression.

Show the age of the films

film director year age
A bout de souffle Godard 1960 60
Tirez sur le pianiste Truffaut 1960 60
Cléo de 5 à 7 Varda 1962 58
Jules et Jim Truffaut 1962 58
Pierrot le fou Godard 1965 55
Week-End Godard 1967 53
Die verlorene Ehre der Katharina Blum von Trotta 1975 45
Der starke Ferdinand Kluge 1976 44
Sans toi ni loi Varda 1985 35

Note that the expression knows only the values fromthe current row.
We can also manipulate text

Make a pretty text with the film entry

pretty
A bout de souffle (Godard, 1960)
Tirez sur le pianiste (Truffaut, 1960)
Cléo de 5 à 7 (Varda, 1962)
Jules et Jim (Truffaut, 1962)
Pierrot le fou (Godard, 1965)
Week-End (Godard, 1967)
Die verlorene Ehre der Katharina Blum (von Trotta, 1975)
Der starke Ferdinand (Kluge, 1976)
Sans toi ni loi (Varda, 1985)

Go to Tutorial 8

' ===Extend===

' No the fun begins. We can create new values from the existing columns. Extend creates a new column based on an expression.

' '''''Show the age of the films'''''

read "films.csv"

extend age = 2020 - year

print

' Note that the expression knows only the values fromthe current row.

' We can also manipulate text

' '''''Make a pretty text with the film entry'''''

read "films.csv"

extend pretty = film. " (" .director. ", " .year. ")"

project pretty

print

' Go to [[Tutorial 8]]