4.41 fldsize - Number of Fields

Format: fldsize()

Return the number of fields in the input file. MCMD assumes all records in the input data has same number of fields, thus the resulting value from the function applies to all records.

Examples

Example 1: Basic Example

$ more dat1.csv
a,b,c,d
1,2,3,4
2,3,4,5
3,,,
4,x,y,z
$ mcal c='fldsize()' a=rsl i=dat1.csv o=rsl1.csv
#END# kgcal a=rsl c=fldsize() i=dat1.csv o=rsl1.csv
$ more rsl1.csv
a,b,c,d,rsl
1,2,3,4,4
2,3,4,5,4
3,,,,4
4,x,y,z,4