Skip to content

Instantly share code, notes, and snippets.

@Softwaretrain
Created September 17, 2022 17:39
Show Gist options
  • Save Softwaretrain/0e13904c41388e31063069ce1e923c6e to your computer and use it in GitHub Desktop.
Save Softwaretrain/0e13904c41388e31063069ce1e923c6e to your computer and use it in GitHub Desktop.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("LcxBCoMwEIXhqzyyFgnd9ADdeIc0izGmphA6YWZEvL1Run3fzwvBJbIBC6/YM4mikOHDAqoVndTFITgrGXPn9+b946lolQ7F/rWCJJzuZspocpDCGFe/8jLe8CIjNeHWR/79T+MJ", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Original Text" = _t]),
ReplaceText=Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSk4sUdJRcgaSsTrRSiUZqUBeCJAE8ZJSE4uAXCcQBeInF+UngxQDqfyUzJzUYrBoen4KUNAdSIJ4BUWVicVAfkFRYiVQPhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [From = _t, To = _t]),
#"Added Custom" = Table.AddColumn(Source, "Final Text", each let
Translation = List.Buffer(
List.Zip(
Table.ToColumns(ReplaceText)
)),
Output=Text.Combine(
List.ReplaceMatchingItems(
Text.Split(
Text.Replace(
Text.Replace([Original Text],","," ,"),
"."," .")
," "),
Translation
)," "
)
in
Text.Replace(
Text.Replace(Output," ,",","),
" .",".")
)
in
#"Added Custom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment