In my input I have data that contains both lower case and upper case. I want to convert all lowercase to uppercase and upper case to lowercase. How can I achieve this using abinitio.

if (string_filter(in.column, “abcdefghijklmnopqrstuvwxyz”) != “”)
string_upcase(in.column)
else
if (string_filter(in.column, “ABCDEFGHIJKLMNOPQRSTUVWXYZ”) != “”)
string_downcase(in.column)
else
in.column

Cheers
Kranthi Kumar

Hi Lakshmi -

Here you go, this inverts and also preserves none alpha characters

out::flip_case(in) = begin
let string(1)[int] flip_vec = reinterpret_as(string(1),in);

let string(1)[int] flipped_vec = allocate_with_nulls();
for ( let i= 0, i < length_of(flip_vec))
begin
if ((flip_vec) member [ vector “A”,“B”,“C”,“D”,“E”,“F”,“G”,“H”,“I”,“J”,“K”,“L”,“M”,“N”,“O”,“P”,“Q”,“R”,“S”,“T”,“U”,“V”,“W”,“X”,“Y”,“Z” ] )
begin
flipped_vec = vector_append(flipped_vec, string_downcase(flip_vec));
end
else if ((flip_vec) member [ vector “a”,“b”,“c”,“d”,“e”,“f”,“g”,“h”,“i”,“j”,“k”,“l”,“m”,“n”,“o”,“p”,“q”,“r”,“s”,“t”,“u”,“v”,“w”,“x”,“y”,“z” ] )
begin
flipped_vec = vector_append(flipped_vec, string_upcase(flip_vec));
end
else flipped_vec = vector_append(flipped_vec, flip_vec);
end;

out :: string_join(flipped_vec,‘’);
end;

Cheers

Chris Day

c: +44 7930 909 297
p: +44 207 870 3390
h: www.intelligent-decision.com
L: https://uk.linkedin.com/in/chrisdaybusinessintelligence

Try this code if it works for you.I got results correctly

begin
let string(int)[int] str=string_split_no_empty(re_replace(TXT,“”,“,”),“,”);
let decimal(“,”) len=length_of(TXT);
let i=0;
let string(“|”) res=‘’;
while (i

Try string like function as condition for determining input case of data
and based on op of it use string downcase and string upcase function.

Warm regards,
Ramnath
+91-9545445792

sent from cellphone

you can do it by using string-downcase function and string-upcase function

Sent from my Mi phone
On Community_Member email@removed, 22 Mar 2016 18:45 wrote:

Question from Lakshmi on Mar 22 at 9:09 AM In my input I have data that contains both lower case and upper case. I want to convert all lowercase to uppercase and upper case to lowercase. How can I achieve this using abinitio.

Reply to this email to post your response.