Last active
March 12, 2017 15:36
-
-
Save lukeisontheroad/d2a9af41c6f2dfc3ed207d5bd5834080 to your computer and use it in GitHub Desktop.
persons-raw.wrangle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
splitrows col: column1 on: '\n' quote: '\"' | |
split col: column1 on: ',' limit: 9 quote: '\"' | |
replace col: * with: '' on: '\"' global: true | |
header | |
settype col: Index type: 'Integer' | |
set col: First_Name value: proper($col) | |
settype col: Date_Of_Birth type: 'Datetime','dd-mm-yy','dd*mm*yyyy' | |
settype col: Small_Shirt_Size type: 'Bool' | |
settype col: Small_Shirt_Size type: 'String' | |
settype col: Date_Of_Birth type: 'String' | |
derive value: if(len(Date_Of_Birth) == 8, merge([substring(Date_Of_Birth, 0, 6),'19',substring(Date_Of_Birth, 6, 8)]), Date_Of_Birth) as: 'column1' | |
drop col: Date_Of_Birth | |
rename col: column1 to: 'Date_Of_Birth' | |
derive value: if(Small_Shirt_Size == 'X', 'S', if(Medium_Shirt_Size == 'X', 'M', if(Large_Shirt_Size == 'X', 'L', ''))) as: 'Merged_Size' | |
drop col: Small_Shirt_Size | |
drop col: Medium_Shirt_Size | |
drop col: Large_Shirt_Size | |
settype col: Index type: 'Integer' | |
settype col: Merged_Size type: 'Array' | |
settype col: Merged_Size type: 'Map' | |
settype col: Merged_Size type: 'String' | |
delete row: ismissing([Index]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment