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.
Format of command
utllf {-a|-d} {[-s separator-name]|[-sx separator-code]|[-l record-len]} [-k S|8|G] [-i filename] [-o filename] [-r]
Explanation of the parameters
- -a|-d
-
Specify whether newline characters should be added or deleted (Mandatory)
- -a:
-
Add carriage return line feed codes (CRLF)
- -d:
-
Delete carriage return line feed codes (CRLF)
- -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) code.
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|8|G
-
Specify the Code Set for Transfer of the data (Optional)
- S:
-
Shift-JIS
- 8:
-
UTF-8
- G:
-
GB18030
HULFT uses the specified code set when re-formatting during editing of data. If you omit this parameter, HULFT uses Shift-JIS.
- -i filename
-
Specify the input file name (Optional)
Specify a character string within 256 bytes.
If omitted, HULFT uses the standard input.
- -o filename
-
Specify the output file name (Optional)
Specify a 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
-
The newline character (0x0D0A) should exist in the byte position next to the record length specified by '-l.'
-
When sending format data to where the newline character (0x0D0A) exists in the record delimiter, specify '-l' to delete the newline character because '0x0D0A' is meaningless data in send destination hosts that are not Windows. Because HULFT cannot tell whether the newline character (0x0D0A) is binary data or a newline character in the format data, '-l' should be specified. If you delete the newline character from the text data, it is not necessary to specify '-l.'
-
'-k S|8|G' is not a parameter for specifying a conversion to the specified character code.
Remarks
If "Unrecoverable Mode" (1) is specified for Transfer-Related File Deletion Mode (trnsfr_file_del) in the System Environment Settings, and you need to delete data that was edited during the processing, you cannot recover the deleted data.
Setting examples
-
When you want to delete newline characters
utllf -d -i D:\tmp\test.dat -o D:\tmp\test2.dat
-
When you want to delete newline characters every 100 bytes
utllf -d -l 100 -i D:\tmp\test.dat -o D:\tmp\test2.dat
-
When you want to add newline characters after double quotation marks (")
utllf -a -s \" -k 8 -i D:\tmp\test.dat -o D:\tmp\test2.dat
-
When you want to add newline characters after hexadecimal code 0x1f
utllf -a -sx 0x1f -i D:\tmp\test.dat -o D:\tmp\test2.dat
-
When you want to add newline characters every 200 bytes
utllf -a -l 200 -i D:\tmp\test.dat -o D:\tmp\test2.dat