Forum Discussion

pkumarsharma's avatar
pkumarsharma
Regular Visitor
3 years ago
Solved

Text Splitter

I want to split text by number of characters but if at that certain position the word is not complete then take it to the end of the word.    Text Split by Number of Characters 25 Increase num...
  • slorin's avatar
    3 years ago

    Add a new column 

    Splitter.SplitTextByPositions( 
    Table.Group(
    Table.FromColumns({{0}&Text.PositionOf([Text]," ",Occurrence.All)},{"Position"}),
    {"Position"},
    {},
    GroupKind.Local,
    (x,y)=>if y[Position]>(x[Position]+25) then 1 else 0)
    [Position])
    ([Text])

     

     Stéphane