Created
January 12, 2022 15:26
-
-
Save TheCloudScout/fad1becb6448b6502250a2e7654b7259 to your computer and use it in GitHub Desktop.
This file contains 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
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 | |
| where string_ has_all("Country:", "City:", "dish:") | |
| parse-where string_ with * | |
"Country: " country:string | |
"City: " city:string | |
"Local dish: " localDish:string | |
| project-away string_; | |
let parser2 = unparsedData | |
| where string_ has_all("City: ", "Attraction:", "dish:") | |
| parse-where string_ with * | |
"City: " city:string | |
"Attraction: " attraction:string | |
"Local dish: " localDish:string | |
| project-away string_; | |
let parser3 = unparsedData | |
| where string_ has_all("Country:", "State:", "Population:", "Attraction:") | |
| parse-where string_ with * | |
"Country: " country:string | |
"State: " state:string | |
"Population: " population:int | |
"Attraction: " attraction:string | |
| project-away string_; | |
let parser4 = unparsedData | |
| where string_ has_all("State:", "City:", "Population:", "Attraction:", "dish:") | |
| 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