Skip to content

Instantly share code, notes, and snippets.

@TheCloudScout
Last active January 12, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheCloudScout/335574198f87925f43cb2f1cc65492a9 to your computer and use it in GitHub Desktop.
Save TheCloudScout/335574198f87925f43cb2f1cc65492a9 to your computer and use it in GitHub Desktop.
let unparsedData = datatable( string_:string )
[
"Country: United States City: Chicago Local dish: Deep dish pizza",
"City: New York City Attraction: Statue of Liberty Local dish: Cheesecake",
"Country: United States State: NV Population: 641903 Attraction: Fremont Street",
"State: CA City:San Francisco Population: 873965 Attraction: Golden Gate Bridge Local dish: Clam Chowder"
];
let parser1 = unparsedData
| parse-where string_ with *
"Country: " country:string
"City: " city:string
"Local dish: " localDish:string
| project-away string_;
let parser2 = unparsedData
| parse-where string_ with *
"City: " city:string
"Attraction: " attraction:string
"Local dish: " localDish:string
| project-away string_;
let parser3 = unparsedData
| parse-where string_ with *
"Country: " country:string
"State: " state:string
"Population: " population:int
"Attraction: " attraction:string
| project-away string_;
let parser4 = unparsedData
| parse-where string_ with *
"State: " state:string
"City:" city:string
"Population: " population:int
"Attraction: " attraction:string
"Local dish: " localDish:string
| project-away string_;
union
parser1,
parser2,
parser3,
parser4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment