JP2000020280A - Data reference method - Google Patents

Data reference method

Info

Publication number
JP2000020280A
JP2000020280A JP18852998A JP18852998A JP2000020280A JP 2000020280 A JP2000020280 A JP 2000020280A JP 18852998 A JP18852998 A JP 18852998A JP 18852998 A JP18852998 A JP 18852998A JP 2000020280 A JP2000020280 A JP 2000020280A
Authority
JP
Japan
Prior art keywords
data
file
character code
recording unit
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP18852998A
Other languages
Japanese (ja)
Inventor
Toshihiro Kiyono
智弘 清野
Takashi Takahashi
隆 高橋
Tsugio Kise
次男 木瀬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP18852998A priority Critical patent/JP2000020280A/en
Publication of JP2000020280A publication Critical patent/JP2000020280A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce character code converting processing at the time of referring to data at any arbitrary position of a file with a character code different from a recorded character code by storing the data length of each recording unit after character code conversion and the position of each recording unit on a recording medium in a table. SOLUTION: File data are converted into different character codes for every recording unit of data and the data length of each recording unit after the character code conversion and the position of each recording unit on the recording medium are stored in the table. In such a conversion table 110, data for one block are stored in continuous areas on the recording medium. The conversion table 110 stores a file ID 100 for identifying an object file, character code classes 101-103 and data lengths 105-107 after various kinds of character code conversion corresponding to a recording position 104 of each block on the recording medium. Besides, the number 108 of all the blocks belonging to the object file is recorded.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、一般にコンピュー
タシステムに関し、特に計算機のファイルシステムの文
字コード変換を伴ったファイルデータ参照方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention generally relates to a computer system, and more particularly to a file data referencing method with character code conversion of a computer file system.

【0002】[0002]

【従来の技術】文字データをコンピュータシステムに記
録する方法として用いられているものに、1バイトのコ
ードでアルファベットやカナ文字を表す1バイトコード
と、漢字などの文字種が256文字を超える文字体系を
表す2バイトコードがある。
2. Description of the Related Art One method of recording character data in a computer system includes a one-byte code representing an alphabet or a kana character using a one-byte code and a character system having a character type such as a kanji character of more than 256 characters. There is a two-byte code to represent.

【0003】アルファベットやカナ文字と漢字が混じっ
たテキストデータを記録する方法として、1バイトコー
ドと2バイトコードを切り換えコードを用いて混在させ
る方法と、2バイトコードで全ての文字を表す方法があ
る。
As a method of recording text data in which alphabets, kana characters, and kanji are mixed, there are a method of mixing 1-byte codes and 2-byte codes by using a switching code, and a method of expressing all characters by 2-byte codes. .

【0004】同じテキストでも使用する文字コードによ
ってデータの長さが異なるため、テキストファイルの入
出力を記録された文字コードとは別の文字コードで行う
場合、当該ファイル内の任意のデータ位置に位置付ける
にはファイルのデータ全体の文字コード変換を行う必要
があった。
Since the length of data differs depending on the character code used even in the same text, if input / output of a text file is performed using a character code different from the recorded character code, the text file is positioned at an arbitrary data position in the file. Needed to perform character code conversion of the entire file data.

【0005】[0005]

【発明が解決しようとする課題】上記のようにファイル
の任意の位置のデータを別の文字コードで参照するに
は、ファイルのデータ全体の文字コード変換を行わなけ
ればならないという問題があった。
As described above, in order to refer to data at an arbitrary position in a file with another character code, there has been a problem that the character code of the entire file data must be converted.

【0006】本発明の目的は、ファイルの任意の位置の
データを記録された文字コードとは別の文字コードで参
照する時の文字コード変換処理を削減する方法を提供す
ることにある。
An object of the present invention is to provide a method for reducing a character code conversion process when data at an arbitrary position in a file is referred to by a character code different from a recorded character code.

【0007】[0007]

【課題を解決するための手段】上記目的を達成するため
に、本発明のデータ参照方法では、ファイルデータを別
の文字コードにデータの記録単位毎に変換し、各記録単
位の文字コード変換後のデータ長と各記録単位の記録媒
体上の位置をテーブルに格納するステップを有する。
In order to achieve the above object, according to the data reference method of the present invention, file data is converted into another character code for each recording unit of data, and the character code of each recording unit is converted. And storing the data length of each recording unit and the position on the recording medium of each recording unit in a table.

【0008】また、本発明のデータ参照方法では、前記
テーブルに記録されている文字コード変換後のデータ長
を加算し、各記録単位のファイル先頭からの位置を求
め、入出力対象データが含まれる記録単位の記録媒体上
の位置と入出力対象データの記録単位内での相対位置を
求めるステップを有する。
Further, in the data reference method of the present invention, the data length after the character code conversion recorded in the table is added, the position of each recording unit from the file head is obtained, and the data to be input / output is included. Calculating a relative position of the recording unit on the recording medium and the input / output target data within the recording unit.

【0009】本発明のデータ参照方法によって、テーブ
ルが作成されたファイルの文字コード変換後の任意の位
置のデータを参照する場合、ファイルデータ全体の文字
コード変換を行わずに入出力対象データに位置付けるこ
とができる。
According to the data reference method of the present invention, when referencing data at an arbitrary position after character code conversion of a file in which a table is created, the file is positioned as input / output target data without performing character code conversion of the entire file data. be able to.

【0010】[0010]

【発明の実施の形態】以下、本発明の実施例を説明す
る。
Embodiments of the present invention will be described below.

【0011】図1は文字コード変換後の各ブロックのデ
ータ長を文字コード種毎に格納する変換テーブルを示
す。ブロックとは一回の入出力要求で読み書きできるデ
ータの記録媒体上の記録単位であり、1ブロックのデー
タは記録媒体上では連続した領域に格納されている。変
換テーブル110には対象ファイルを識別するファイル
ID100と、文字コード種別101,102,10
3、そして各ブロックの記録媒体上の記録位置104に
対応して各種文字コード変換後のデータ長105,10
6,107が格納される。また、対象ファイルに属する
全ブロックの数108が記録される。
FIG. 1 shows a conversion table for storing the data length of each block after character code conversion for each character code type. A block is a recording unit on a recording medium of data that can be read and written by one input / output request, and one block of data is stored in a continuous area on the recording medium. The conversion table 110 includes a file ID 100 for identifying the target file, and character code types 101, 102, and 10.
3, and data lengths 105 and 10 after various character code conversions corresponding to the recording position 104 on the recording medium of each block.
6,107 are stored. Also, the number 108 of all blocks belonging to the target file is recorded.

【0012】図2は本発明のデータ参照方法の変換テー
ブルの作成の手順、ファイルの位置付けの手順が実行さ
れる契機を示した図である。ユーザがファイルに対して
要求10を出すと、要求解釈処理11が実行され、ユー
ザの要求によりファイルOPEN処理12、READ処
理13、WRITE処理14、ファイルCLOSE処理
15のいずれかが実行される。
FIG. 2 is a diagram showing an opportunity for executing a procedure for creating a conversion table and a procedure for positioning a file according to the data reference method of the present invention. When the user issues a request 10 to a file, a request interpretation process 11 is executed, and one of a file OPEN process 12, a READ process 13, a WRITE process 14, and a file CLOSE process 15 is executed according to the user's request.

【0013】ユーザの要求がファイルのオープンである
場合はファイルOPEN処理12が実行される。要求時
に文字コード種別を指定していると、変換テーブル作成
処理16が呼び出され、変換テーブル110が作成され
る。変換テーブル110の内容は特殊ファイルとしてシ
ステムに記録される。
If the user's request is to open a file, a file OPEN process 12 is executed. If the character code type is specified at the time of the request, the conversion table creation processing 16 is called, and the conversion table 110 is created. The contents of the conversion table 110 are recorded in the system as a special file.

【0014】図3にファイルオープンのユーザプログラ
ム例を示す。参照する文字コード種別CODE1(40
1)を指定してファイル”userfile01”(4
02)をオープンすると、変換テーブルが未作成の場合
は作成され、文字コード種別101と指定したコード4
01に変換した後のブロック毎のデータ長105に情報
が格納される。READ(403)はファイルを読み取
り専用でオープンすることを示す。
FIG. 3 shows an example of a file open user program. The character code type CODE1 (40
1) to specify the file “userfile01” (4
02), the conversion table is created if the conversion table has not been created, and the character code type 101 and the designated code 4
The information is stored in the data length 105 for each block after conversion to 01. READ (403) indicates that the file is opened for reading only.

【0015】指定ファイル402のファイル制御情報に
は該当する変換テーブルが格納された特殊ファイルのフ
ァイル名、またはその特殊ファイルのファイル制御ブロ
ックのアドレスが記録される。これ以降、同じ文字コー
ドを指定してオープンした場合は、既に作成済みの変換
テーブル110が使用される。
In the file control information of the designated file 402, a file name of a special file storing the corresponding conversion table or an address of a file control block of the special file is recorded. Thereafter, if the same character code is specified and opened, the already created conversion table 110 is used.

【0016】2回目に異なる文字コードを指定してオー
プンした場合は、その文字コード種別102と各ブロッ
クを変換した後のデータ長106が作成済みの変換テー
ブル110に追加される。3回目以降も同様に、文字コ
ード種別と各ブロックの文字コード変換後のデータ長
が、変換テーブル110に追加される。
When a different character code is specified and opened for the second time, the character code type 102 and the data length 106 after each block is converted are added to the created conversion table 110. Similarly, after the third time, the character code type and the data length of each block after the character code conversion are added to the conversion table 110.

【0017】ユーザの要求10がファイルからのデータ
入力である場合は、READ処理13が実行され、ファ
イルへのデータ出力である場合は、WRITE処理14
が実行される。READ処理13とWRITE処理14
では、ファイル位置付け処理17を呼び出し、入出力対
象データへの位置付けを行った後、データの入出力を行
う。
If the user request 10 is a data input from a file, a READ process 13 is executed, and if the user request 10 is a data output to a file, a WRITE process 14
Is executed. READ processing 13 and WRITE processing 14
Then, the file positioning process 17 is called to position the input / output target data, and then input / output data.

【0018】図4は本発明のデータ参照方法の変換テー
ブル作成手順を示す。最初にブロック数を0に初期化す
る(201)。次にデータを1ブロック入力し(20
2)、ファイルの終端に達したかどうかを判定する(2
03)。ファイル終端でないときは、入力したデータに
文字コード変換を施し(204)、入力データの記録位
置と変換後のデータ長を変換テーブルに記録し(20
5)、ブロック数に1を加える(206)。次のブロッ
クを入力する処理(202)へ戻り、ファイル終端に到
達するまで繰り返す。最後にブロック数と文字コード種
別を変換テーブルに記録する(207)。
FIG. 4 shows a procedure for creating a conversion table in the data reference method of the present invention. First, the number of blocks is initialized to 0 (201). Next, one block of data is input (20
2) Determine whether the end of the file has been reached (2)
03). If it is not the end of the file, the input data is subjected to character code conversion (204), and the recording position of the input data and the converted data length are recorded in the conversion table (20).
5) Add 1 to the number of blocks (206). Returning to the process of inputting the next block (202), the process is repeated until the end of the file is reached. Finally, the number of blocks and the character code type are recorded in the conversion table (207).

【0019】図5は本発明のデータ参照方法の位置付け
手順を示す。文字コード変換後のファイルにおける入出
力位置を与えると、当該位置のデータを含むブロックの
記録媒体上の位置SAと当該データのブロック内の相対
位置OFが得られる。
FIG. 5 shows a positioning procedure of the data reference method of the present invention. Given the input / output position in the file after the character code conversion, the position SA on the recording medium of the block including the data at the position and the relative position OF of the data within the block are obtained.

【0020】図6は記録媒体上のファイルを示す。50
1は記録媒体の先頭であり、502は入出力対象ブロッ
クの先頭、503は次のブロックの先頭を示す。SAは
記録媒体の先頭501を基点とした入出力対象ブロック
の先頭502の位置のことであり、OFは入出力対象ブ
ロックの先頭502を基点とした入出力対象データ50
4の位置のことである。
FIG. 6 shows a file on a recording medium. 50
1 is the head of the recording medium, 502 is the head of the input / output target block, and 503 is the head of the next block. SA is the position of the head 502 of the input / output target block starting from the head 501 of the recording medium, and OF is the input / output target data 50 starting from the head 502 of the input / output target block.
4 position.

【0021】図5の位置付け手順では始めに変換後のデ
ータ長の累計RAを0に初期化する(301)。次にフ
ァイルの全ブロックを処理したかを判定し(302)、
まだ処理していないときは、RAに現在のブロックの変
換後のデータ長を加算する(303)。RAと入出力位
置を比較し(304)、RAの方が小さければ302へ
戻って次のブロックに対して、処理を行う。RAが入出
力位置に達したならば、現在のブロックの位置を入出力
位置から減算し、ブロック内の相対位置を求める(30
5)。また、当該ブロックの記録媒体上の位置を変換テ
ーブルから求める(305)。全ブロックのデータ長累
計RAが入出力位置に達しないときはエラーを返す(3
06)。
In the positioning procedure of FIG. 5, first, the total RA of the converted data length is initialized to 0 (301). Next, it is determined whether all blocks of the file have been processed (302).
If the data length has not been processed yet, the converted data length of the current block is added to RA (303). The RA is compared with the input / output position (304), and if the RA is smaller, the process returns to 302 and the next block is processed. When RA reaches the input / output position, the current position of the block is subtracted from the input / output position to obtain a relative position in the block (30).
5). Further, the position of the block on the recording medium is obtained from the conversion table (305). If the total data length RA of all blocks does not reach the input / output position, an error is returned (3
06).

【0022】[0022]

【発明の効果】本発明によれば、一度変換テーブルを作
成すれば、その後の文字コード変換を伴うテキストデー
タ入出力時には、入出力する部分の記録単位のデータの
文字コード変換を行うだけでよいため、ファイル入出力
時の文字コード変換処理とそれにかかる時間を削減でき
るという効果がある。
According to the present invention, once a conversion table is created, when text data is input / output with subsequent character code conversion, only the character code conversion of the data in the recording unit of the input / output portion is required. Therefore, there is an effect that the character code conversion process at the time of file input / output and the time required for the process can be reduced.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例の変換テーブルを示す図であ
る。
FIG. 1 is a diagram showing a conversion table according to an embodiment of the present invention.

【図2】本発明の変換テーブルの作成処理、ファイル位
置付け処理が実行される契機を示す図である。
FIG. 2 is a diagram showing an opportunity to execute a conversion table creation process and a file positioning process according to the present invention.

【図3】文字コード種別を指定したファイルオープンの
プログラム例を示す図である。
FIG. 3 is a diagram showing an example of a file open program specifying a character code type;

【図4】変換テーブル作成手順のフローチャート図であ
る。
FIG. 4 is a flowchart of a conversion table creation procedure.

【図5】ファイル位置付け手順のフローチャート図であ
る。
FIG. 5 is a flowchart of a file positioning procedure.

【図6】記録媒体上の入出力対象データの位置を示す図
である。
FIG. 6 is a diagram showing the position of input / output target data on a recording medium.

【符号の説明】[Explanation of symbols]

100…ファイルID、 101,102,103…文
字コード種別格納領域、104…記録媒体上の記録位置
格納領域、105,106,107…変換後データ長格
納領域、108…ファイルのブロック数格納領域、
110…変換テーブル、10…ユーザからの要求、11
…要求解釈処理、12…ファイルオープン処理、13…
ファイル入力処理、14…ファイル出力処理、15…フ
ァイルクローズ処理、 16…変換テーブル作成
処理、17…ファイル位置付け処理、 501…記
録媒体の先頭位置、502…入出力対象ブロックの先頭
位置、503…入出力対象の次のブロックの先頭位置、
504…入出力対象データ。
100: File ID, 101, 102, 103: Character code type storage area, 104: Recording position storage area on the recording medium, 105, 106, 107: Converted data length storage area, 108: File block number storage area
110: conversion table, 10: request from user, 11
... Request interpretation processing, 12 ... File open processing, 13 ...
File input processing, 14 File output processing, 15 File close processing, 16 Conversion table creation processing, 17 File positioning processing, 501 Head position of recording medium, 502 Head position of input / output target block, 503 Input The start position of the next block to be output,
504: Input / output target data.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】テキストファイルのデータ参照方法におい
て、データの文字コード変換を記録媒体上で物理的に連
続した記録単位毎に行うステップと、各記録単位のデー
タの記録媒体上の位置と各記録単位のデータの文字コー
ド変換後の長さをファイルの先頭から順に記録したテー
ブルを作成するステップと、を含むことを特徴とするデ
ータ参照方法。
In a method of referring to data of a text file, a step of performing a character code conversion of data for each physically continuous recording unit on a recording medium, a position of the data of each recording unit on the recording medium, and each recording unit Creating a table in which the length of the unit data after the character code conversion is recorded in order from the beginning of the file.
【請求項2】請求項1記載のテーブルに記録された文字
コード変換後のデータの長さを加算し、各記録単位のフ
ァイルの先頭からの位置を求めるステップと、前記位置
から入出力の対象となるデータが含まれる記録単位と、
入出力の対象となるデータの前記記録単位内における相
対位置を求めるステップと、を含むことを特徴とするデ
ータ参照方法。
2. A step of adding a length of data after the character code conversion recorded in the table according to claim 1 to obtain a position from a head of a file of each recording unit, and an input / output object from the position. A recording unit that contains the data that
Obtaining a relative position of the data to be input / output in the recording unit.
JP18852998A 1998-07-03 1998-07-03 Data reference method Pending JP2000020280A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18852998A JP2000020280A (en) 1998-07-03 1998-07-03 Data reference method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18852998A JP2000020280A (en) 1998-07-03 1998-07-03 Data reference method

Publications (1)

Publication Number Publication Date
JP2000020280A true JP2000020280A (en) 2000-01-21

Family

ID=16225312

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18852998A Pending JP2000020280A (en) 1998-07-03 1998-07-03 Data reference method

Country Status (1)

Country Link
JP (1) JP2000020280A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010001979A1 (en) * 2008-06-30 2010-01-07 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same, and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010001979A1 (en) * 2008-06-30 2010-01-07 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same, and storage medium
JP2010009483A (en) * 2008-06-30 2010-01-14 Canon Inc Information processing apparatus, control method thereof, and program
KR101179370B1 (en) 2008-06-30 2012-09-03 캐논 가부시끼가이샤 Information processing apparatus, method of controlling the same, and storage medium
US9405760B2 (en) 2008-06-30 2016-08-02 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same, and storage medium

Similar Documents

Publication Publication Date Title
JPH0668720B2 (en) DEVICE, METHOD AND STRUCTURE FOR CONVERTING DOCUMENT WITH ONE STRUCTURE TO DOCUMENT WITH OTHER STRUCTURE
JP2006268299A (en) Software development support system
JP2000020280A (en) Data reference method
JPH10232867A (en) Document processing method, document processor and recording medium recording document processing program
CN119248287B (en) OLE object analysis method and device, computer equipment and storage medium
US20040205666A1 (en) System and method for anticipated file editing
JP2005505807A (en) Method and system for realizing a maintenance environment for computer program code
JP3023681B2 (en) Document processing device
JPS61157938A (en) Format conversion of binary data
JPH02255978A (en) Document data conversion method
KR19980072391A (en) How to convert Arc / Info intermediate files to KXF data format
JP2000348026A (en) Character replacement device
JP2558692B2 (en) Document file device
JP2665016B2 (en) Code conversion method
JPH05257702A (en) System for preparing macro built-in type intermediate language text file
JP2933222B2 (en) Document processing device
JPH04242420A (en) Magnetic tape data recording system
JPH11203279A (en) Kana-kanji conversion device, kana-kanji conversion method, and storage medium
JP2000194534A (en) Code conversion system
JPS61264433A (en) Electronic equipment
KR19980072257A (en) How to convert a KXF file to an ArcInfo info intermediate file
JPH07152858A (en) Method and system for management of character recognition ofplurality of document format images with common data type
JPH1021240A (en) Machine translation device and machine translation method
JPS6279562A (en) Document data conversion method
JP2001318913A (en) Method and device for expanding external character allowed to be used by application and recording medium