The transformation of MARC data format and database format

Source: Internet
Author: User
Tags chr manual header readable
Data | Database First of all thanks to Csdn on the Djkhym (Hym), to my great help, drawing on his program of thought.



MARC (Machine readable catalogue) data, machine-readable directory data. The transformation of Marc format and database is an important part of the book system as well as the core technology. Now there is little information on the online Mar data, and there is less information on the conversion of the database .... I mainly refer to the "Chinese machine reading directory format using the manual" and hym procedures, in order to reduce detours, so I wrote this experience. (Huh, now online to turn a MARC data to 2 cents?)

The basic format of Marc data, we can be in the "Chinese machine Readable directory format use manual" detailed inquiries. Here, I'll simply say. This Marc data format follows the standard of GB/T 2901 (ISO 2709), and the extension is. iso. The following is a line in the ISO file of Marc, a Marc data.

00806NAM0 2200229 450 0010009000000100035000090920020000441000041000641010008001051020015001131050018001281060006001462000031001522100033001832 15001500216330020500231333008500436606000500521690000800526701001500534801002700549? S7240011? a7-5034-1525-8b Hardcover dCNY130.00? Acnb01-724-0011? A20021211d2002 ekmy0chiy0121 ea? Achi? aCNb110000? Ay z 000yy? Ar?1 A Deng Xiaoping theory dictionary f Li Changfu editor? A Beijing C Chinese literature and history press d2004.7? A0720d16 open? A book is a comprehensive, systematic, accurate reflection of the scientific system of Deng Xiaoping Theory and the search for the important views of Deng Xiaoping theory, for the majority of party members, cadres and the masses to learn, research, promote Deng Xiaoping theory of reference books. The whole book, while reflecting and elaborating Deng Xiaoping's theory, also covers Marxism-Leninism and Mao Zedong. The core content of a thought and the important thought of "three represents" embodies the development vein of the Theory of scientific socialism. A? Av4? 0a Li Changfu editor? acnbs7240011c20040709?



Record structure: Record header, address catalog area, data field area, record Terminator

00806nam0 to 450# is the record header (#代表空格)

001000900000 to 801002700549@ is the Address catalog area (@ Represents the field separator IS2)

S7240011 to 20040709@ is the data field area

% is the record terminator (% represents the record Terminator IS3)

Specific each byte has a special meaning, we can read, I speak here about their own conversion experience.

1. Calculation of field Length: 0-4-bit is the total length of the record, note contains spaces and separator markers. English characters 1 digits, Chinese characters 2 bits. Note that the result of Len ("I") in ASP is one, so the writing length in VB is calculated as follows: LenB (StrConv (St1, vbFromUnicode)), then format the output using format (str1,00000).

2. Several symbols:

$: Word Field identifier IS1

@ Represents the field separator IS2

% represents record Terminator IS3

This is an artificial marker for easy learning and viewing. In the actual system, these characters are generally substituted for the following:

$--------Chr (31)

@--------Chr (30)

%--------Chr (29)

There is also a space is very important, the space between each field is strictly defined, so learn to use the # to represent the space. Like header: 01071nam0#2200277## #450 #

3. The understanding of the Address catalogue area: Artificially added, and, the separation, is very obvious.

001,0013,00000;005,0017,00013 ...................... 801,0022,00771@

Here 001,0013,00000 is the first field that represents the Data field area, Field Number: 001, Length: 0013, starting position: 00000. The analogy behind it is the position in addition.

The calculation method of Dbtomarc, first write the data field area, and then a field of the calculation of a field, you can open an array: block (I, 3), blocks (i, 0) for identification, block (i,1) column width, block (i, 3) columns position, I refers to the number of fields.

Marctodb is the reverse. Read first, and truncate the data field area.

The Address catalog area must calculate is right, otherwise the computer does not know, the data behind is misplaced.

4. Data field Area:

Write by field (read out). One thing to note:

012001022343@20020928000000.0@## $a 7-80142-191-4$dcny46.00@................................................@%

is the number of spaces and the use of delimited symbols, we must pay attention to, otherwise the format is wrong, not machine-readable, this is my lesson ah ....

5, transforms the database field to make the configuration file, may choose the transformation, facilitates the program general purpose.

and edit Convention rules, such as the database records: Title [release], title < series > so get the release, judge whether it is a series. There are no more than 3 editors ... Look at the versatility of your program.

6. Pinyin implementation, I was looking at the array implementation, do not know if there is no other good way ...

7. Again, this data transformation is important to the requirements of the form of thorough reading, the other algorithm is query writing, see your foundation. I like to use the array, hehe ...



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.