DtoLine [ -f field-format-list ] [ -p field-format-list ] [ -t default-delimiter ] [ -z default-options ] [ input-file.. ]
DtoLine converts D-records in the input-files into lines of a plain text file. By default, DtoLine generates a line from an input D-record, concatenating value part of the fields with the default delimiter (Tab). All fields of the input record appear in the output line, keeping the field sequence of the input record.
The default delimiter and the output format options can be changed with -t and -z options.
When a -f field-format-list option is given (but no -p option), field values are converted through the given format. Note that -f option does not select fields, nor change the field sequence.
When a -p field-format-list option is given, only listed fields appear in the output line, in the order listed. When a listed field is not in the input record, null string is assumed for the field. When a listed field appears more than two in the record, those fields are output repeatedly. When no listed field is found in the record, null line (a line with length zero) is produced. Same field name may repeat in the list. Same value is repeated as you have listed.
Output .csv file (without field name line):
DtoLine -t , -z q
(Assuming all records have same field sequence without repeating fields. You may use -p option to ensure the field order, but still without repeating fields.)
Command:
DtoLine -f "b://,c:/;/,a:/:/"
Input:
a:A1
b:B1
c:C1
d:D1
a:A2
c:C21
b:B2
c:C22
Result:
A1:B1C1;D1
A2:C21;B2C22
Command:
DtoLine -p recordcount
Input:
recordcount:1
fieldcount:3
charcount:37
Result:
1
Command:
DtoLine -t ":" -f "user:/\,/"
Input:
groupname:sys
passwd:
gid:3
user:root
user:bin
user:sys
user:adm
Result:
sys::3:root,bin,sys,adm
See the manual of D_msg.
MIYAZAWA Akira