Appendix P (Import/Export File Formats). DORIC 9.65, INFO-Text software
जाहिरात
जाहिरात
Appendix P IMPORT/EXPORT File Formats
Overview
This appendix discusses the six pre-set file formats that
IMPORT and EXPORT supports. These formats are
ASCII, SDF, 20/20, DIF, SYLK and CSV. It is possible to create other file formats yourself. See INFO-Exchange manual.
For this discussion, we use a sample datafile containing character, numeric, and date data. We print the datafile in each of the formats discussed below so that you can compare the formats. It is not necessary for you to define this datafile in your own work area.
$RECNO SALES
REGION
1
2
3
NORTHEAST
CENTRAL
WEST
ASCII Format
END.DATE
31-MAR-96
30-JUN-96
3--SEP-96
FORECAST
SALES
ACTUAL
SALES
200000
200000
200000
165000
210000
295000
In ASCII file format, each item value is delimited by a carriage return. Each records is delimited by two carriage returns. Character and date data are enclosed in double quotation marks. The example looks like this in ASCII:
“NORTHEAST”
“31-MAR-96”
200000
165000
“CENTRAL”
“30-JUN-96”
200000
210000
“WEST”
“30-SEP-96”
200000
295000
INFO Reference Manual Appendices A-125
IMPORT/EXPORT File Formats Appendix P
SYLK Format
CSV Format
INFO adheres to the format specified in Multi-plan documentation. When INFO reads a SYLK file, however, it ignores all formulae, storing only characters, numeric and data.
Our sales information file looks like this in SYLK format:
ID;INFO
B;Y3;X4
C:Y1;X1;K”NORTHEAST”
C:Y1;X2;K”31-MAR-1996”
C;Y1;X3;K200000
C;Y1;X4;K165000
C:Y2;X1;K”CENTRAL”
C:Y2;X2;K”30-JUN-1996”
C;Y2;X3;K200000
C;Y2;X4;K210000
C:Y3;X1;K”WEST”
C:Y3;X2;K”30-SEP-1996”
C;Y3;X3;K200000
C;Y3;X4;K295000
E
Comma Separated Values. INFO assumes that character items and dates are held as strings separated by commas with no quotation marks around the character items..
Example of the above data in CSV format:
NORTHEAST,31/03/1996,200000,165000
CENTRAL,31/06/1996,200000,210000
WEST,30/09/1996,200000,295000
A-126 Appendices INFO Reference Manual
Appendix P IMPORT/EXPORT File Formats
SDF Format
SDF format uses a comma as an item-value delimiter and a carriage return as a record delimiter. Character and date data are enclosed in double quotation marks
“NORTHEAST”,”31-MAR-1996”,200000,165000
“CENTRAL”,“30-JUN-1996”,200000,210000
“WEST”,”30-SEP-1996”,200000,295000
2020 Format
2020 format uses a # sign as an item-value delimiter and two # signs as a record delimiter. Character and date data are preceded by a quotation mark. If it is a single quotation mark, the characters are right-hand justified in the cell. If it is a double quotation mark, the characters are left-hand justified in the cell.
DIF Format
‘NORTHEAST#‘31-MAR-1996#200000#165000##
‘CENTRAL#‘30-JUN-1996#200000#210000##
‘WEST#‘30-SEP-1996#200000#295000##
DIF format appears more complex than the preceding three formats because it contains a header in addition to the data.
Header
The header of a DIF file contains data on the file name, the number of records in the file, and the number of item values in each record.
Every piece of information in a header requires three lines.
The first line is a label giving the type of information that follows. The second line is a row/column (often called a vector) designation. The last line is the information itself.
If the information consists of characters, it is enclosed in double quotation marks.
The file name is recorded as
TABLE
0,1
“NAME OF FILE”
INFO Reference Manual Appendices A-127
IMPORT/EXPORT File Formats Appendix P
Where NAME OF FILE represents the real name of the file. The row/column designation with the row equal to zero indicates that this is header information.
The number of items (columns) is recorded as follows:
VECTORS
0 NUMBER
“ “
Where NUMBER represents the number of items in the file
The number of records (called tuples in DIF) is recorded as follows:
TUPLES
0, NUMBER
“ “
The information in the header consists of the item names.
They are recorded as.
LABEL
#,0
“NAME”
Where # is the number of the column for this item, and
NAME is the item name.
The end of the header uses a marker to indicate the beginning of the data section. This entry is written as:
DATA
0,0
“ “
Data
Each record is marked by a special record called BOT
(Beginning of Tuple)
-1,0
BOT
A-128 Appendices INFO Reference Manual
Appendix P IMPORT/EXPORT File Formats
Each item value is represented by two lines: a numeric line and a character line. For numbers, these two lines take the form
0, number
V
Where number is the actual data.
Character data is written as
1,0
“text”
Where 1,0 is a code explaining that string text follows, and
“text” is the text itself.
The very end of the file is delimited with an EOD or endof-data record.
-1,0
EOD
Example Datafile in DIF Format
TABLE
0,1
“SALES.USA”
VECTORS
0,4
“ “
TUPLES
0,3
“ “
LABEL
1,0
“SALES. REGION”
LABEL
2,0
“END. DATE”
LABEL
3,0
“FORCAST.SALES”
LABEL
INFO Reference Manual Appendices A-129
IMPORT/EXPORT File Formats Appendix P
4,0
“ACTUAL. SALES”
DATA
0,0
“ “
-1,0
BOT
1,0
“NORTHEAST”
1,0
“31-MAR-1996”
0,200000
V
0,165000
V
-1,0
BOT
1,0
“CENTRAL”
1,0
“30-MAR-1996”
0,200000
V
0,210000
V
-1,0
BOT
1,0
“WEST”
1,0
“30-SEPT-1996”
0,200000
V
0,295000
V
-1,0
EOD
A-130 Appendices INFO Reference Manual
Appendix P IMPORT/EXPORT File Formats
Overview
This section describes how to modify the format table to conform to your file formats.
The format definitions for the six file types handled by
INFO are all stored in one table. You can customize the file formats by modifying the table. You make these modifications using your operating system’s editor software.
Use the Editor
The format table is located in the INFOSYS directory with
To Make Changes the other INFO software. You should copy this file, by its system name, into your system directory. The file name is
info9inx (Unix and Primos) or info9.inx (VMS)
Fields in the
Format Table
Once this copy—under the same name—is in your directory, run the editor. You can alter any of the entries in info9inx or you can add a new line with your own file format.
The table of file formats has several columns. Table O-1 shows the contents of the fields in the format table.
Table O-1. Fields in the Format Table
Field Name Description
FILE FORMAT Name of the format. This is the name used in the
IMPORT or EXPORT command line. It must be written in capital letters.
DELI Delimiter character between fields.
DATE FORM
TXT ENC
LFT TXT
If text is input into a date item type, it is translated into
INFO date storage format from this assumed convention.
Tells INFO whether text has text string delimiters at both ends. If it does, then a double appearance of the delimiter character is taken to be a single appearance of the character in text, that is, ‘INFO’’S RULE’ is translated as
INFO’S RULE.
Character indicating left-justified text.
INFO Reference Manual Appendices A-131
IMPORT/EXPORT File Formats Appendix P
Table O-1. Fields in the Format Table (cont’d)
Field Name Description
RT TXT
REP CHR
BEG ROW
END ROW
EOD
CELL CONT
NUM
TEXT
BEG-OF-DATA
ROW
COL
SHR VAL
REF
ROW REF
COL REF
Character indicating right-justified text.
Character indicating that next character should be repeated across the cell.
Character indicating that next field is start of new logical record.
Character indicating that no more fields are to be passed for current logical record.
Character indicating end of data.
Character indicating that record contains a data value.
Character indicating that numeric data follows.
Character indicating that text data follows.
Character indicating that data follows.
Character value indicating row where current cell is stored.
Character and value indicating column where current cell is stored.
Character indicating that current cell value is used again by another cell; current cell is called a shared cell.
Character indicating that current cell is filed using data from an earlier cell.
Character and value indicating the row from which to take a shared cell.
Character and value indicating the column from which to take a shared cell.
A-132 Appendices INFO Reference Manual
Appendix P IMPORT/EXPORT File Formats
Sources of
Error
Date Formats
Summary
If you elect to add your own file format to the format table, it is important to remember that minor modifications are more apt to work than an entirely new format. Feel free to change a delimiter, but, if you add a new format, take care to follow all the guidelines
Do not specify both NONE for DELI and NO for TXT ENC.
Although published specifications for DIF and SYLK file formats allow extension through additional features, they also state that programs using DIF format should explicity ignore any fields they do not recognize. This is our policy as well. If you make an addition to a DIF file, and INFO does not recognize it, the IMPORT command ignores it.
Most spreadsheets use a date format like this:
29-FEB-1996
The format table contains a column that uses INFO DFMT command notation to set up the date format of the imported data. If you use a spreadsheet with a different date format, you can change the format table so that its format is supported.
INFO handles a large number of date formats; make sure that the table entry you use matches the DFMT command’s date formats.
INFO uses a format table to store information on the delimited file formats its supports. You can use your operating system’s editor to make alterations to this table.
You should, however, keep in mind the many sources of error you can introduce when you alter a working system.
see also
EXPORT
IMPORT
Appendix G “Controlling Default Assignments”
INFO Reference Manual Appendices A-133
डाउनलोड
जाहिरात