File Record Edit command
This command carries out a record-by-record addition or deletion of newline characters in files converted to a CSV format or targeted by Receive processing of HULFT.
HULFT outputs the generated files either to the standard output or in the specified file.
Syntax for the File Record Edit command
utllf {-a|-d} {[-s separator-name]|[-sx separator-code]|[-l record-len]} [-k S|E|8|G] [-i filename] [-o filename] [-r]
Explanation of the parameters
- -a|-d
-
Specify whether to add or delete newline characters (Mandatory)
- -a:
-
Add line feed codes.
- -d:
-
Delete line feed codes.
- -s separator-name|-sx separator-code|-l record-len
-
Specify where to add or delete the newline character (Optional)
- -s:
-
Add a newline character after the specified separator (trailer) character.
- -sx:
-
Add a newline character after the specified separator (trailer).
The separator can be specified using hexadecimal. The code is specified in the format of '0xXX.' (XX specifies the code in hexadecimal.)
- -l:
-
In combination with -a, add a newline character after the specified record length.
In combination with -d, delete a newline character after the specified record length.
The maximum value that you can set is 32767 bytes.
One of the above three parameters must be specified when -a is set. When -d is specified, only -l can be specified. (Optional)
- -k S|E|8|G
-
Specify the Code Set for Transfer of the data (Optional)
- S:
-
Shift-JIS
- E:
-
EUC-JP
- 8:
-
UTF-8
- G:
-
GB18030
HULFT uses the specified code set when re-formatting during editing of data. If you omit this parameter, Shift-JIS is applied.
- -i filename
-
Specify the input file name (Optional)
Specify the file name as an alphanumeric character string within 256 bytes.
If omitted, HULFT uses the standard input.
- -o filename
-
Specify the output file name (Optional)
Specify the file name as an alphanumeric character string within 256 bytes.
If omitted, HULFT uses the standard output.
- -r
-
Specify override of the output file (Optional)
If you omit this parameter and the output file already exists, an error occurs.
Note
'-k S|E|8|G' is not a parameter to convert data from one character encoding to another character encoding.
<Setting examples>
When you want to delete newline characters
utllf -d -i /tmp/test.dat -o /tmp/test2.dat
When you want to delete newline characters every 100 bytes
utllf -d -l 100 -i /tmp/test.dat -o /tmp/test2.dat
When you want to add newline characters after double quotation marks (")
utllf -a -s \" -k E -i /tmp/test.dat -o /tmp/test2.dat
When you want to add newline characters after hexadecimal code 0x1f
utllf -a -sx 0x1f -i /tmp/test.dat -o /tmp/test2.dat
When you want to add newline characters every 200 bytes
utllf -a -l 200 -i /tmp/test.dat -o /tmp/test2.dat