How to get all Uppercase Word in raw?

kellyjkon

New Member
Joined
Nov 30, 2022
Messages
11
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

I tried many options such as text.split, delimiter, add custom column from example but I could not succeed. I'm sure the Power Query gurus here will figure this out easily.

My question is actually simple, I want to filter all uppercase words in a line. But since my data came as multiple line, I couldn't separate them with spaces or commas, or I could only get capital letters.
How can I get only the KAMA, WAL, SSSSSS values in the example you see below?

1669807801161.png


Thanks a lot in advance!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl = Table.TransformColumns(Source, {"Column1", each 
            let ts = Text.Split(_, ", "),
                upper = List.Select(ts, (x)=> x=Text.Upper(x))
            in Text.Combine(upper, ", ")})
in
    tbl

Book4
ABCD
1Column1Column1
2aaa, BBBB, cc, DD, efg, XYZBBBB, DD, XYZ
3DGHS, APPLE, pear, BANANADGHS, APPLE, BANANA
4
Sheet2
 
Upvote 0
Thanks but comma delimiter doesn't work in my case.
Because as you can see in screenshot my data in multiple line, so, there is no comma separator after KAMA word.
"Bey, hm sp. , KAMA WAL , Tl sp, SSSSSS"
 
Upvote 0
maybe this

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl = Table.TransformColumns(Source, {"Column1", each 
            let ts = List.RemoveItems(Text.Split(Text.Replace(_," ",","), ","),{""}),
                upper = List.Select(ts, (x)=> x=Text.Upper(x))
            in Text.Combine(upper, ", ")})
in
    tbl

Book1
ABCD
1Column1Column1
2Bey, hm sp. , KAMA WAL , Tl sp, SSSSSSKAMA, WAL, SSSSSS
3
Sheet3
 
Upvote 0
How can I implement that in power query/power bi? It gave an error when I added it with the Add Column option.
 
Upvote 0
As you can see below, There is no space or comma after KAMA. WAL starts with second line in same row. That's my problem because it doesn't identify properly them due to there are no commas or space.


1669896091193.png
 
Upvote 0
maybe

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl = Table.TransformColumns(Source, {"Column1", each 
            let lf = Character.FromNumber(10),
                ts = Text.Split(Text.Replace(_,lf,", "), ", "),
                upper = List.Select(ts, (x)=> x=Text.Upper(x))
            in Text.Combine(upper, ", ")})
in
    tbl

Book1
ABCD
1Column1Column1
2Bey, hm sp. , KAMA WAL, Tl sp, SSSSSSKAMA, WAL, SSSSSS
3
Sheet3
 
Upvote 0
Solution
maybe

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl = Table.TransformColumns(Source, {"Column1", each
            let lf = Character.FromNumber(10),
                ts = Text.Split(Text.Replace(_,lf,", "), ", "),
                upper = List.Select(ts, (x)=> x=Text.Upper(x))
            in Text.Combine(upper, ", ")})
in
    tbl

Book1
ABCD
1Column1Column1
2Bey, hm sp. , KAMA WAL, Tl sp, SSSSSSKAMA, WAL, SSSSSS
3
Sheet3

So cool! it works now! however, i'm just wondering that you use Character.FromNumber(10) , does it just look at the line after the 10th character or does 10 have another meaning?
because sometimes the length of the first line can be 50 characters or even 5 different multiple lines in a row. The situations below are possible that's why i'm asking.

fale fatal seone crico kulonale fatal seone crico kulo KALAAA
crico kulonale fatal seone crico kulo crico kulonale fatal seone crico kulo fale fatal seone crico kulonale fatal seone crico kulo KALAAA
one crico kulo KALAAA fale fatal seone crico kulonale fatal se
 
Upvote 0
Character.FromNumber(10) is the line feed character. I am replacing all line feeds in a cell with ", " and then splitting on ", " and then working with that resultant list.
 
Upvote 0

Forum statistics

Threads
1,223,989
Messages
6,175,814
Members
452,672
Latest member
missbanana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top