Format 1: right(, length)
Format 2: rightw(, length)
Return the number of characters as defined in the parameter from the right side of the string in . Use rightw function if the string contains multibyte characters.
Extract the last 3 characters from the end in the str column.
$ more dat1.csv id,str 1,abcdefg 2,12345678 3, 4,12 $ mcal c='right($s{str},3)' a=rsl i=dat1.csv o=rsl1.csv #END# kgcal a=rsl c=right($s{str},3) i=dat1.csv o=rsl1.csv $ more rsl1.csv id,str,rsl 1,abcdefg,efg 2,12345678,678 3,, 4,12,12
Use the function right if the data contains multibyte characters.
$ more dat2.csv id,str 1,あいうえお 2,1234567あ8 3,1あ 4,ああ $ mcal c='right($s{str},6)' a=rsl i=dat2.csv o=rsl2.csv #END# kgcal a=rsl c=right($s{str},6) i=dat2.csv o=rsl2.csv $ more rsl2.csv id,str,rsl 1,あいうえお,えお 2,1234567あ8,67あ8 3,1あ,1あ 4,ああ,ああ