Relation:parse

Analyses a column of the current relation with a regex pattern and creates new columns.

Description

parse column regexpattern newcolumn (, newcolumn2...)

Parameters

column: any existing column

regexpattern: any valid regular expression (see regex). Use paranthesises to capture groups.

newcolumn: any valid name

Examples

Using the sample relation films.csv

read "films.csv"
parse film "^(S+?)[s\-](.*)" firstword, rest
film director year firstword rest
A bout de souffle Godard 1960 A bout de souffle
Tirez sur le pianiste Truffaut 1960 Tirez sur le pianiste
Cléo de 5 à 7 Varda 1962 Cléo de 5 à 7
Jules et Jim Truffaut 1962 Jules et Jim
Pierrot le fou Godard 1965 Pierrot le fou
Week-End Godard 1967 Week End
Die verlorene Ehre der Katharina Blum von Trotta 1975 Die verlorene Ehre der Katharina Blum
Der starke Ferdinand Kluge 1976 Der starke Ferdinand
Sans toi ni loi Varda 1985 Sans toi ni loi

Comments

Parse is a second step after import, when you have special formats.

See also

import regex