Format 1: mid(, starting position, length)
Format 2: midw(, starting position, length)
Extract the character string from the specified starting position for a specified length. Note that the starting position starts from 0. Use leftw function if the string contains multibyte characters.
Extract the first 3 characters from the beginning in the str column.
$ more dat1.csv id,str 1,abcdefg 2,12345678 3, 4,12 $ mcal c='mid($s{str},2,3)' a=rsl i=dat1.csv o=rsl1.csv #END# kgcal a=rsl c=mid($s{str},2,3) i=dat1.csv o=rsl1.csv $ more rsl1.csv id,str,rsl 1,abcdefg,cde 2,12345678,345 3,, 4,12,