Format: cat()
Concatenate the specified in order using
as the delimiter to create a character string. If an empty character "" is specified, the list of strings are simply concatenated.
Concatenate 3 columns str1,str2,str3 with the inclusion of "#" as delimiter token in between characters.
$ more dat1.csv id,str1,str2,str3 1,abc,def,ghi 2,A,,CDE 3,,, 4,,,XY $ mcal c='cat("#",$s{str1},$s{str2},$s{str3})' a=rsl i=dat1.csv o=rsl1.csv #END# kgcal a=rsl c=cat("#",$s{str1},$s{str2},$s{str3}) i=dat1.csv o=rsl1.csv $ more rsl1.csv id,str1,str2,str3,rsl 1,abc,def,ghi,abc#def#ghi 2,A,,CDE,A##CDE 3,,,,## 4,,,XY,##XY
$ mcal c='cat("",$s{str1},$s{str2},$s{str3})' a=rsl i=dat1.csv o=rsl2.csv #END# kgcal a=rsl c=cat("",$s{str1},$s{str2},$s{str3}) i=dat1.csv o=rsl2.csv $ more rsl2.csv id,str1,str2,str3,rsl 1,abc,def,ghi,abcdefghi 2,A,,CDE,ACDE 3,,,, 4,,,XY,XY
Use wildcard to specify columns names that start with str (str1,str2,str3) such as str*.
$ mcal c='cat("",$s{str*})' a=rsl i=dat1.csv o=rsl3.csv #END# kgcal a=rsl c=cat("",$s{str*}) i=dat1.csv o=rsl3.csv $ more rsl3.csv id,str1,str2,str3,rsl 1,abc,def,ghi,abcdefghi 2,A,,CDE,ACDE 3,,,, 4,,,XY,XY