none
Combiner.CombineText RRS feed

Answers

  • Hi Tom

    Sure:

    let
        Source = {"MarcelBeug","Tom","J","Sun"},
    
        ByDelimiter = Combiner.CombineTextByDelimiter(",")(Source), 
        // Result: MarcelBeug,Tom,J,Sun
    
        ByEachDelimiter = Combiner.CombineTextByEachDelimiter({" *1* ","* 2 *", "* 3 *"})(Source),  
        // Result: MarcelBeug *1* Tom* 2 *J* 3 *Sun    
    
        ByLengths = Combiner.CombineTextByLengths({6,10,2,7})(Source),  
        // Result: MarcelTom       J Sun
    
        ByPositionsWithTemplate = Combiner.CombineTextByPositions({6,31,35,37},"I am:                 You are:")(Source),  
        // Result: I am: MarcelBeug      You are: Tom J Sun
    
        ByRangesWithTemplate = Combiner.CombineTextByRanges({{0,15},{20,10},{30,5},{40,7}},Text.Repeat(".",50))(Source)  
        // Result: MarcelBeug..........Tom.......J.........Sun.......
    
    in
        ByRangesWithTemplate

    Cheers,

    Marcel

    • Marked as answer by Tom J Sun Monday, December 19, 2016 10:56 PM
    Monday, December 19, 2016 3:21 AM

All replies

  • All Combiner functions create functions to combine a list of texts into 1 text field.

    • ...ByDelimiter puts a delimiter between the original parts.
    • ...ByEachDelimiter puts a different delimiter (in turn) between the original parts (part1 -d1- part2 -d2- etcetera).
    • ...ByLengths: part 1 will get length 1, part2 will get length 2 etcetera.
      Parts may be truncated or padded with spaces (except for the last part, unless an additional length is provided).
    • ...ByPositions puts each part at the specified position, optionally in a template (string with text in which the text parts are positioned).
    • ...ByRanges works like ...ByPositions, but each part may be truncated to the supplied lengths.

    Friday, December 16, 2016 6:07 AM
  • Hi Marcelbeug,

    Thanks for the explanation.

    Is that possible for you to provide a few detailed examples?

    Without the examples it is pretty hard for me to fully understand.

    Cheers,

    Tom Sun

    Monday, December 19, 2016 1:14 AM
  • Hi Tom

    Sure:

    let
        Source = {"MarcelBeug","Tom","J","Sun"},
    
        ByDelimiter = Combiner.CombineTextByDelimiter(",")(Source), 
        // Result: MarcelBeug,Tom,J,Sun
    
        ByEachDelimiter = Combiner.CombineTextByEachDelimiter({" *1* ","* 2 *", "* 3 *"})(Source),  
        // Result: MarcelBeug *1* Tom* 2 *J* 3 *Sun    
    
        ByLengths = Combiner.CombineTextByLengths({6,10,2,7})(Source),  
        // Result: MarcelTom       J Sun
    
        ByPositionsWithTemplate = Combiner.CombineTextByPositions({6,31,35,37},"I am:                 You are:")(Source),  
        // Result: I am: MarcelBeug      You are: Tom J Sun
    
        ByRangesWithTemplate = Combiner.CombineTextByRanges({{0,15},{20,10},{30,5},{40,7}},Text.Repeat(".",50))(Source)  
        // Result: MarcelBeug..........Tom.......J.........Sun.......
    
    in
        ByRangesWithTemplate

    Cheers,

    Marcel

    • Marked as answer by Tom J Sun Monday, December 19, 2016 10:56 PM
    Monday, December 19, 2016 3:21 AM
  • Thanks so much Marcel, really helpful

    Cheers,

    Tom Sun

    Monday, December 19, 2016 10:57 PM
  • Thanks so much Marcel, really helpful

    Cheers,

    Tom Sun


    Hoi Marcel. Thank you. Greetings from Flushing(Vlissingen) Michiel Snoek.
    Wednesday, January 24, 2018 7:14 AM