2.5 Data Type

MCMD handles plain text files in CSV format, where the data is a sequence of characters. Thus, it depends on how the specific command interprets the character string for the data type. For example, the data in field specified at f= in msum command is converted from a character string to a number. As shown in Table 2.1, MCMD can handle six types of data including numeric, character string, date, time, boolean and vector type.

Table 2.1: Six data types supported by MCMD

Data type

Notation of CSV Data type

Details of Conversion

Numerical type

10, 2.5, 1.5E+10

Convert value to a double-precision real number

Character string type

abc, あいう

Process CSV data as it is

Date type

20130920

Convert 8-digit fixed length string to Gregorian calendar object

Time type

20130920151154, 151154

Convert 6 digit or the 14-digit fixed length string to Gregorian calendar + POSIX time object

Boolean type

1,0

Convert character to boolean value. "1" is true and “0” is false

Vector type

a c b, 1 5 11

Character string delimited by space can be converted to any data type above.

Further, list of data types of commonly used commands is shown in Table 2.2.

Table 2.2: Data types of commonly used commands

Data type

Command

Details

Numerical type

msum

Calculate total of numeric field

 

msim

Calculate the similarity between two fields

String type

mjoin

Combine fields from the reference file

 

mcombi

Enumerate combination

Date type

age function of mcal

Calculate Age

 

leapyear function of mcal

Determine leap year

Time type

now function of mcal

Output the current time

 

diffminute function of mcal

Calculate the time difference in minutes

Boolean type

and function of mcal

Compute the logical product

 

if function of mcal

Set the value of the criteria

ベクトル型

mvsort

Sort vector elements

 

mvuniq

Extract unique vector elements