# US 2004/0083242 A1 · Method and apparatus for locating and transforming data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0083242 A1
- Document ID: US20040083242A1
- Status: Published application
- Kind: A1
- Application number: 10/689,186
- Filed: 2003-10-20
- Published: 2004-04-29
- Earliest claimed: 2002-10-24
- Assignees: International Business Machines Corporation
- Inventors: Sheng Ye; Wei Sun; Zhong Tian
- Web page: https://patentgrep.com/patent/US20040083242A1

## CPC

- G06F 16/258: {Data format conversion from or to a database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The invention provides method and apparatus for locating data in a data file and for transforming the data. The method comprises the steps: determining the data unit to be located in the data file; determining a type for the data unit, the type including “Text”, “SingleLine”, “MultiLine”, “Block” and “Iterator”; when the type of the data unit is not “Text”, selecting a different data unit as the location reference for the data unit; generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit, the description including the type of the data unit, one or more location elements for locating the data unit and including “Top”, “Bottom”, “Left” and “Right”, each of the location elements including a combination of attributes so as to determine the position of the location element. The invention may locate the data position by two dimensional area.

## Claims

### Claim 1

A method for locating data in a data file, comprising:
determining the data unit to be located in the data file;
determining a type for the data unit,
when the type of the data unit is not Text,
selecting a different data unit as the location reference for the data unit;
generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit, the description including the type of the data unit, one or more location elements for locating the data unit;
each of the location elements including a combination of attributes so as to determine the position of the location element, the attributes including:
a. a base different data unit;
b. a from position in the base used as the location referring position for the location element; and
c. a skip which represents the offset of the location element from the from position.

### Claim 2 (depends on 1)

The method of claim 1 wherein the type is chosen from the group consisting of Text, SingleLine, MultiLine, Block and Iterator

### Claim 3 (depends on 1)

The method of claim 1 wherein when generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit, and the description includes the type of the data unit, and at least one location elements for locating the data unit and chosen from the group consisting of Top, Bottom, Left and Right.

### Claim 4 (depends on 1)

The method of claim 1 wherein each of the location elements includes a combination of attributes so as to determine the position of the location element, said attributes chosen from the group consisting of a base different data unit, a position in the base different data unit and used as the location referring position for the location element; and an offset of the location element from the base different data unit.

### Claim 5 (depends on 1)

The method for locating data in a data file according to claim 1, characterized in that the base different data unit is the data unit having the type “Text” or any data unit the attributes of the location elements of which have been determined.

### Claim 6 (depends on 1)

The method for locating data in a data file according to claim 1, characterized in that the attributes further include:
a. an until representing location element stops at a markup;
b. a before representing the offset of the location element stops before a markup;
c. an after representing the offset of the location element stops after a markup.

### Claim 7 (depends on 1)

The method for locating data in a data file according to claim 1, characterized in that the from is the start position or the end position of the base.

### Claim 8

An apparatus for locating data in a data file, comprising:
a data unit determination unit, a type determination unit, a location reference determination unit and a data unit location description generation unit,
said data unit determination unit determining the data unit to be located in the data file;
said type determination unit determining a type for the data unit, the type including “Text”, “SingleLine”, “MultiLine”, “Block” and “Iterator”;
when the type of the data unit is not “Text”,
a. said location reference determination unit selecting a different data unit as the location reference for the data unit;
b. said data unit location description generation unit generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit, the description including the type of the data unit, one or more location elements for locating the data unit and including “Top”, “Bottom”, “Left” and “Right”,
c. each of the location elements including a combination of attributes so as to determine the position of the location element, the attributes including:
i. “Base”, which is the different data unit;
ii. “From”, which is a position in the “Base” and used as the location referring position for the location element;
iii. “Skip”, which represents the offset of the location element from the “From”.

### Claim 9 (depends on 8)

The apparatus for locating data in a data file according to claim 8, characterized in that the “Base” is the data unit having the type of “Text” or any data unit the attributes of the location elements of which have been determined.

### Claim 10 (depends on 8)

The apparatus for locating data in a data file according to claim 8, characterized in that the attributes further include:
a. “Until”, which represents the location element stops at a markup;
b. “Before”, which represents the offset of the location element stops before a markup; and
c. “After”, which represents the offset of the location element stops after a markup.

### Claim 11 (depends on 8)

The apparatus for locating data in a data file according to claim 8, characterized in that the “From” is the start position or the end position of the “Base”.

### Claim 12

A data transformation method, for transforming data in a first data file having a first format into data in a second data file having a second format, the data transformation method comprising:
a. searching the data in the first data file to determine the position of the data;
b. extracting the data the position of which has been determined;
c. transforming the extracted data into data in the second data file,
characterized by:
i. generating the location description for one or more data units in the first data file to be located, and building up the correspondence between the data units and the second format of the second data file, before the data searching step,
ii. for each of the data units, performing the steps:
iii. determining a type for the data unit, the type including “Text”, “SingleLine”, “MultiLine”, “Block” and “Iterator”;
when the type of the data unit is not “Text”,
a. selecting a different data unit as the location reference for the data unit;
b. generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit, the description including the type of the data unit, one or more location elements for locating the data unit and including “Top”, “Bottom”, “Left” and “Right”,
c. each of the location elements including a combination of attributes so as to determine the position of the location element, the attributes including:
i. “Base”, which is the different data unit;
ii. “From”, which is a position in the “Base” and used as the location referring position for the location element;
iii. “Skip”, which represents the offset of the location element from the “From”,
d. said data searching step locating the data units based on the location descriptions on the one or more data units;
e. said data extracting step extracting the one or more data units being located;
f. said data transformation step transforming the data units in the first data file extracted in said data extracting step into the data having the second format, based on the correspondence build between the one or more data units and the second format, so as to generate the data in one or more second data files.

### Claim 13 (depends on 12)

The data transformation method according to claim 12, characterized in that the “Base” is the data unit having the type of “Text” or any data unit the attributes of the location elements of which have been determined.

### Claim 14 (depends on 12)

The data transformation method according to claim 12, characterized in that the attributes further include:
a. “Until”, which represents the location element stops at a markup;
b. “Before”, which represents the offset of the location element stops before a markup; and
c. “After”, which represents the offset of the location element stops after a markup.

### Claim 15 (depends on 12)

The data transformation method according to claim 12, characterized in that the “From” is the start position or the end position of the “Base”.

### Claim 16

A data transformation apparatus, for transforming data in a first data file having a first format into data in a second data file having a second format, the data transformation apparatus comprising:
a. a data searching unit, for searching the data in the first data file to determine the position of the data;
b. a data extracting unit, for extracting the data the position of which has been determined;
c. a data transforming unit, for transforming the extracted data into data in the second data file,
characterized in that: said data transformation apparatus further comprises:
a. a data unit determination unit, a type determination unit, a location reference determination unit, a data unit location description generation unit and a format mapping unit,
b. said data unit determination unit determining the data unit to be located in the data file;
c. for each of the data units, performing the steps:
i. determining a type for the data unit, the type including “Text”, “SingleLine”, “MultiLine”, “Block” and “Iterator”;
ii. when the type of the data unit is not “Text”,
(a). selecting a different data unit as the location reference for the data unit;
(b). generating the location description for the data unit, based on the type of the data unit and the position relationship between the data unit and the different data unit,
(c) the description including the type of the data unit, one or more location elements for locating the data unit and including “Top”, “Bottom”, “Left” and “Right”,
d. each of the location elements including a combination of attributes so as to determine the position of the location element, the attributes including:
i. “Base”, which is the different data unit;
ii. “From”, which is a position in the “Base” and used as the location referring position for the location element;
iii. “Skip”, which represents the offset of the location element from the “From”,
e. said format mapping unit building up the correspondence between the one or more data units and the second format of the second data file,
f. said data searching unit searching the data units based on the location descriptions on the one or more data units and determining the positions thereof;
g. said data extracting unit extracting the one or more data units the positions of which have been determined;
h. said data transformation unit transforming the data units in the first data file extracted in said data extracting unit into the data having the second format, based on the correspondence build between the one or more data units and the second format, so as to generate the data in one or more second data files.

### Claim 17 (depends on 16)

The data transformation apparatus according to claim 16, characterized in that the “Base” is the data unit having the type of “Text” or any data unit the attributes of the location elements of which have been determined.

### Claim 18 (depends on 16)

The data transformation apparatus according to claim 16, characterized in that the attributes further include:
a. “Until”, which represents the location element stops at a markup;
b. “Before”, which represents the offset of the location element stops before a markup;
c, “After”, which represents the offset of the location element stops after a markup.

### Claim 19 (depends on 16)

The data transformation apparatus according to claim 16, characterized in that the “From” is the start position or the end position of the “Base”.
