Hello all

I had a XML files like this one

<?xml version="1.0" encoding="UTF-8"?>
<attr tag="00020000" vr="UL" len="4">180</attr>
<attr tag="00020001" vr="OB" len="2">00\01</attr>
<attr tag="00020002" vr="UI" len="26">1.2.840.10008.</attr>
<attr tag="00020003" vr="UI"

I wrote this simple PigLatin program in order to be able to read these files

*register H:/apps/pig-0.7.0/pig-0.7.0-core.jar;
register H:/apps/pig-0.7.0/piggybank.jar;
A = load 'dicoms/' using org.apache.pig.piggybank.storage.XMLLoader('attr')
as (x: chararray);
B = foreach A generate x;
store B into 'dicoms/searchtest';*

and that works well :)

But I don't know how I can access this information for example if I want to
store the files that contain certain information in a file

for example I want something like that

D = split A into file1 if attr = 180 and file2 if attr= 170

Do I have to change the way I read the file ( *as (x: chararray); *) or I
have to change the way I use it after I read it (D = split A into file1 if
attr = 180 and file2 if attr= 170)

Thanks very much for your help

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupuser @
categoriespig, hadoop
postedFeb 17, '11 at 2:42p
activeFeb 17, '11 at 2:42p

1 user in discussion

Baraa Mohamad: 1 post



site design / logo © 2021 Grokbase