Settings of receiving in CSV format
In order to convert a received file to CSV format, register the delimiter and text enclosures on the host on the receiving side.
Registration can be performed on the HULFT Management Console.
Set the contents for each File ID that has to be converted.
When the File ID is not set, the user's default value is used (Refer to (3) User Default Value).
The value mentioned in (4) Default value of each field is used when the CSV Environment Settings file (hulcsv.inf) does not exist or when the value mentioned in (3) User Default Value is not set.
For details on the CSV Conversion Information Registration screen, refer to CSV Conversion Information Registration screen.
(1) File Name
The name of the CSV Environment Settings file is 'hulcsv.inf.' You cannot change this file name.
The CSV Environment Settings file is stored in the path where the system file of HULFT (HULPATH) exists.
(2) Explanation of each field
The explanation of each field is provided below. Refer to (4) Default value of each field for more information about the default value of each field.
- Receive File ID
-
Specify the ID of the file that is to be converted to CSV format. Specify an alphanumeric character string within 50 bytes.
- Delimiter
-
Specify a character or a symbol that is used as a delimiter between fields.
- One half-width character or symbol:
-
Select one from the following options;
' ! # $ % & ( ) , ^ | " \ /
Otherwise, enter one half-width alphanumeric character or symbol of which the ASCII code ranges between 0x21 and 0x7e in the input field directly.
- TAB:
-
Tab code (0x09)
- SPACE:
-
Space code (0x20)
- NONE:
-
No delimiter character
- Text Enclosure
-
Specify characters or symbols that you use to enclose each field.
- One half-width character or symbol:
-
Select one from the following options;
' ! " # $ % & ( ) , ^ | ~ \ /
Otherwise, enter one half-width alphanumeric character or symbol of which the ASCII code ranges between 0x21 and 0x7e in the input field directly.
- NONE:
-
No text enclosure
- Cut off Trailing Spaces
-
When Field Type in the Format Information is set as 'X,' 'M,' or 'N' and there is a trailing space after the value of that field (including double-byte spaces), if the actual data size is shorter than the Format Information size due to Kanji code conversion, deletion of the space or deletion of the trailing space is specified here.
- Yes:
-
Remove trailing spaces that come after the field.
- No:
-
Do not cut off trailing spaces that come after the field.
- Compress Spaces
-
If Field Type of the Format Information is 'X,' 'M,' or 'N,' the process when the fields are found to be all spaces (including double-byte spaces) is specified here.
- Yes:
-
Delete all spaces.
- No:
-
Set one single-byte space as a field value.
This specification is valid only when Cut off Trailing Spaces is specified as 'Yes.'
In the case of Shift-JIS, the space codes to be omitted are as follows:
-
0x20 (single-byte space)
-
0x8140 (double-byte space)
- Suppress Leading Zero
-
If Field Type in the Format Information is set as 'B,' 'S,' 'P,' 'F,' or '9' and the field values are less than the specified number of display digits (see below), filling of the spaces before the numerical value with '0' is specified here.
- Yes:
-
Cut the '0' before the numerical value.
- No:
-
Fill '0' before the numerical value.
Table 4.19 Conversion Rules for CSV Format Conversion
Receive File (After Conversion)
CSV Data
Field Type
Number of Bytes
Specified Display Digits
F
Floating point
4
30
8
30
P
Signed internal decimal
1–2
12
3–5
12
6–10
21
B
Binary
2
12
4
12
8
21
S
Signed external decimal
1–4
12
5–9
12
10–18
21
= Remarks =-
When Field Type is set as 'F' (Floating point), a maximum of 9 digits is allowed after the decimal point. If the data exceeds the specified number of display digits, the display depends on the data.
-
When 'P' (Signed Internal Decimal)-type or 'S' (Signed External Decimal)-type data is converted to '9' (Unsigned External Decimal)-type data by using the attribute conversion function, the number of display digits depends on the digits in the data. When it is not converted, it depends on the byte count of the field.
-
The specified number of display digits includes the sign (only '-') and the decimal point.
-
HULFT handles binary-type data as data in signed data format.
- Title Output
-
Specify whether or not to output Field Name of the Format Information in the first line as the title line. However, the display of the title line is valid only when Transfer Type (TRANSTYPE) in the Send Management Information is 'FORMAT' (F).
- Yes:
-
Output heading.
- No:
-
Do not output heading.
When the multiple File IDs with the same setup details are present in the CSV Environment Settings file (hulcsv.inf), the same settings can be done with one File ID by setting the File ID 'DEFAULTF' to the default value. When the File ID to be converted does not exist in the CSV Environment Settings file, the value 'DEFAULTF' is set.
When 'DEFAULTF' is not set in the CSV Environment Settings file, the (4) Default value of each field is set.
(4) Default value of each field
The default value of each setting value is given below. When there is no relevant File ID or when the file does not exist, the default value is set as the settings value.
Field Name |
Default Value |
Explanation of Default Value |
---|---|---|
Delimiter |
, (Comma) |
Separate fields with commas (,) |
Text Enclosure |
" (Double quotes) |
Enclose the field value with double quotes (") |
Cut off Trailing Spaces |
Yes |
Remove trailing spaces that come after the field |
Compress Spaces |
Yes |
Delete all spaces |
Suppress Leading Zero |
Yes |
Cut the '0' before the numerical value |
Title Output |
No |
Do not output the title line |
(5) CSV Format File
When receiving in CSV format is carried out, the CSV-format file is created in the same directory as the Receive file.
The file name of the CSV-format file will be '<receive file name>.csv.'
(6) Points to be noted
-
Do not set 'I' to Field Type of Format Information as doing so causes an error during CSV Format Conversion processing.
Since 'I' indicates an image (not converted at the time of transfer), the data may contain the text enclosures or delimiter character mentioned above.
-
In CSV conversion, if there is a NULL character (0x00) in the data, it is considered that data should be processed only up to that point.