none
What's Text.Select for? RRS feed

Answers

  • This was added to support "from example" functionality. To Colin's point, we don't generally mention added library functions to the "what's new" section for a variety of reasons. Does that seem wrong?

    Also, the documentation hasn't been updated for a few months -- also for a variety of reasons, but mostly just because someone should have delegated the work but didn't. It should be updated again soon.

    • Marked as answer by MarcelBeug Tuesday, December 12, 2017 9:31 PM
    Tuesday, December 12, 2017 6:26 PM

All replies

  • This is to select characters from a text, where a string can be supplied as the first parameter and a list of characters as the second parameter.

    I don't know why it is not mentioned in the December feature summary.

    Nor is it added to the Power Query (M) function reference.

    Tuesday, December 12, 2017 6:33 AM
  • Hi Marcel,

    "I don't know why it is not mentioned in the December feature summary."

    "Nor is it added to the Power Query (M) function reference."

    I don't know why you've chosen to raise this issue now, given the following:
    1) New functions are rarely mentioned in the monthly feature summary. Function.From wasn't mentioned in the November summary, so what's new?
    2) Function.From hasn't been added to the reference documentation either - nor has Text.Format, which has been available for some time.

    Documentation issues are the least of my concerns, since it's unlikely to get any better (and the lack of documentation for the two latest functions suggests that it's getting worse).

    I'm more concerned that there's been no significant new Power Query functionality for about six months. I wish that there was a team dedicated to improving the M language, because there's a significant amount of capabilities that this language should have had from day one.

    Tuesday, December 12, 2017 5:27 PM
  • Marcel,

    In addition, you forgot to post some useful examples in your "Curt-style" question followed by answer posts. :)

    I can think of a few:

    1) Extract number from alphanumeric string, e.g. Text.Select("12354RESP", {"0".."9"}) = "12354"

    2) Get the date from a text string, e.g.
    Text.BeforeDelimiter(Text.Trim(Text.Select("The date is 2017/10/5 and the time is 12:30 AM", {"0".."9", "-", "/", " "})), " ") = 2017/10/5

    3) Get the time from a text string, e.g.
    Text.AfterDelimiter(Text.Trim(Text.Select("The date is 2017/10/5 and the time is 12:30 AM", {"0".."9", ":"," ", "A", "P", "M"})), " ", {1, RelativePosition.FromEnd}) = "12:30 AM"

    4) Get date and time, e.g.
    Text.Combine(List.Select(Text.Split(Text.Select("The date is 2017/10/5 and the time is 12:30 AM", {"0".."9", "-", "/", ":", "A", "P", "M", " "}), " "), each _ <> ""), " ") = 2017/10/5 12:30 AM

    and so on...


    Tuesday, December 12, 2017 5:37 PM
  • This was added to support "from example" functionality. To Colin's point, we don't generally mention added library functions to the "what's new" section for a variety of reasons. Does that seem wrong?

    Also, the documentation hasn't been updated for a few months -- also for a variety of reasons, but mostly just because someone should have delegated the work but didn't. It should be updated again soon.

    • Marked as answer by MarcelBeug Tuesday, December 12, 2017 9:31 PM
    Tuesday, December 12, 2017 6:26 PM
  • "This was added to support "from example" functionality. To Colin's point, we don't generally mention added library functions to the "what's new" section for a variety of reasons. Does that seem wrong?"

    I'm not aware of any other mechanism to discover new functions, other than to do a comparison with #shared. In the monthly summary, perhaps there should be a section that lists any new function(s) if available, even if they are not described in any detail. If any function is of an "experimental" nature, then it shouldn't be mentioned. 

    Tuesday, December 12, 2017 6:56 PM
  • Thanks for the feedback. Sorry I was not able to react any sooner.

    My personal opinion below. Feel free to agree or disagree, it's just my opinion.

    To me it just feels strange that a formal programming language is adjusted without notification or update of the documentation.

    With Function.From I can imagine it is not the mentioned in the updates; with Text.Select it's different, as this a kind of function that many people can use in their data transformations.

    When using "from example" functionality, I think that the generated code should always be reviewed for any misinterpretations of the examples, so any function used with this functionality should be documented.

    Tuesday, December 12, 2017 9:30 PM
  • Agree completely with everything you've said. After more than four years of status quo (regarding the state of documentation), I just don't bother with anything related to it. The documentation is no better than the built-in descriptions anyway, and in many instances, it's worse.
    Tuesday, December 12, 2017 10:48 PM
  • Thursday, December 14, 2017 8:49 PM