(Video materials in preparation)
mnameread : Convert multiple name format files to tag format file.
Usage : mnameread <tagname_file> <filename_file>
Options : -s<c>
-n<string>
--off_index
--check
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
When you specify a file containing a list of tag names as the
<tagname_file> and a file containing a list of filenames as the
<filename_file> which containing data in name format, this command
extracts the values of the tags specified in <tagname_file> from the
data contained in <filename_file> and outputs each line of data in
tag format.
The -s<c> option will convert all spaces in the values to <c>. The
default is "_".
The -n<string> option will output <string> in cases where there the
named tag doesn't exist or has no data. The default is "_".
--check option:
Causes an error if any of the following tags exist in
<filename_file>.
1. If multiple data exists for the same tag name. (duplicate)
2. If a tag exists both on its own and in indexed format.
(OK if they exist in separate files.)
$ cat name1
CODE 1234
NAME ABCD
AMOUNT 1,234
$ cat name2
CODE 5678
NAME EFGH
AMOUNT 12,000
$ cat name3
CODE 9999
NAME ZZZZ
AMOUNT 9,999
$ cat tagname
NAME
CODE
AMOUNT
$ cat filename
name1
name2
name3
$ mnameread tagname filename
NAME CODE AMOUNT
ABCD 1234 1,234
EFGH 5678 12,000
ZZZZ 9999 9,999
<Example 2>
If the tag name is in the format tagname_XXX (where XXX is a number
greater than 0), then multiple lines are output.
This function can be turned off with option --off_index.
$ cat name1
CODE_001 1111
CODE_002 2222
NAME ABCD
AMOUNT 1,234
$ cat name2
CODE_001 3333
CODE_002 4444
CODE_003 5555
NAME EFGH
AMOUNT 12,000
$ cat name3
CODE 9999
NAME ZZZZ
AMOUNT 9,999
$ cat tagname
NAME
CODE
AMOUNT
$ cat filename
name1
name2
name3
$ mnameread tagname filename
NAME CODE AMOUNT
ABCD 1111 1,234
ABCD 2222 1,234
EFGH 3333 12,000
EFGH 4444 12,000
EFGH 5555 12,000
ZZZZ 9999 9,999
The old -i option (current -n option) will not be suported.
The old -d option (current -s option) will not be suported.