Table.AddColumn(#"已更改列類型 1", "自定義 (2)", each letcleanText = Text.Replace([備注], "#(lf)", " "),hasTime = Text.Contains(cleanText, "時間:"),hasDate = Text.Contains(cleanText, "日期:"),position = if hasTime then Text.PositionOf(cleanText, "時間:")else if hasDate then Text.PositionOf(cleanText, "日期:")else -1, // 用-1標識未找到關鍵詞result = if position = -1 then [備注] // 未找到時返回原始值else Text.Trim(Text.Range(cleanText, 0, position))
inresult)
添加列-自定義列