UpperCase some data

hello everyone, I want to ask, how can I turn the data to UPPERCASE that just I highlight (row 149448 - 149438)??

I have tried UPPERCASE in String Manipulation, but it doesnt works (surely xD)

So, I just want UpperCase some of my data, not ALL.

NOTE : the data that I highlight, they all are lowercase, the rest is UPPERCASE. but the data that start from ‘‘drg. and dr.’’, I dont want they turn into UPPERCASE.

thank you

image

Hi @takdirzd,

You can use the Column Expressions node for this:

For example:

If this is based on row index, then:

if (between(5, rowIndex(), 15)) upperCase(column("column1"))
else column("column1")

If this is based on a keyword at the beginning of the string, then:

if (regexMatcher(column("column1"), "^(dr\\.|drg\\.).*")) column("column1")
else upperCase(column("column1"))
3 Likes

An alternative, going back to String Manipulation is to use the regexMatcher function along with the “ternary operator” for conditionals

string(
	regexMatcher($SampleData$,"^dr\\..*|^drg\\..*").equals("False")	
	?upperCase($SampleData$)  /* make upper case if not starting with dr. or drg. */
	:$SampleData$ /* otherwise leave alone */
)

image
becomes
image

1 Like

Hi @takdirzd,

beside the two good solutions from @takbb and @armingrudd - here another less cody one :slight_smile:
grafik

In the row splitter just filter for your target rows:
grafik

Then just do with them what you like in the upper path, while the lower path stays the same.
When you are finished just union the table together again

Start data:
grafik

Uppercase on row 5-6
grafik

Uppercase.knwf (10.8 KB)

3 Likes

@AnotherFraudUser “less cody” :joy:

Yes, and that could be adapted for specific patterns too of course, rather than row numbers

e.g.


dr\..*|drg\..*
which pulls it back (a little) towards “cody” :wink:

so anything starting “dr.” or “drg.” goes via the lower route, and nice that the Sorter can now perform a row sort on sequential RowID !

1 Like

@armingrudd @takbb @AnotherFraudUser Thank youu guys, I appreciate that, it works!!!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.