Php – Parser For Uiee Files

Php – Parser For Uiee Files
I need a parser created in PHP for UIEE text files. The parser should read a file that has been uploaded ($_FILES) and then loop through records in the file. Each “field” in the record should be placed in a variable of the same name ($UR, $AA, $TI, etc.). Later I will insert code to insert into a database for each record.

Example format: (Also see attached file which shows three records in the example upload file.)

UR|10
AA|Author
TI|TITLE Subtitle
CN|Very Good in Very Good dust jacket; Defects
AI|Illustrated by Illustrator
MT|Topic
PU|Publisher
PP|Place
DP|Date 3005
ED|2nd Revised and Enlarged German Edition; First Printing
BD|Hardcover
NC|ISBN
NT|Features; Trade PB; Illus. Type; Size; Pages pages; Notes; Signed
NT|by Author & Illustrator
KE|Keyword 1
KE|Keyword 2
KE|Keyword 3
KE|Keyword 4
KE|Keyword 5
KE|Keyword 6
KE|Keyword 7
KE|Keyword 8
KE|Keyword 9
PR|6.00
CO|1
LO|Shelved
IM|http://www.imagelocation.com/Avocado/33333.jpg
XA|4
XB|1
XC|BO
XD|S

In the above example, the UIEE record starts with the UR (User Record Number) tag. This is the standard convention. Subsequently, the remaining fields can appear in any order and not all fields will exist in every record. Most importantly fields can “wrap” to a new line which creates multiple lines for a field, example:

NT|Features; Trade PB; Illus. Type; Size; Pages pages; Notes; Signed
NT|by Author & Illustrator

Thank you for your programming assistance.

Leave a Reply

Your email address will not be published. Required fields are marked *