Fwd: XML to TEXT

2014-02-12 Thread Ranjini Rathinam
Please help to convert this xml to text. I have the attached the xml. Please find the attachement. Some student has two address tag and some student has one address tag and some student dont have address tag tag. I need to convert the xml into string. this is my desired output. 100

Re: XML to TEXT

2014-02-12 Thread Shekhar Sharma
Which input format you are using . Use xml input format. On 3 Jan 2014 10:47, Ranjini Rathinam ranjinibe...@gmail.com wrote: Hi, Need to convert XML into text using mapreduce. I have used DOM and SAX parser. After using SAX Builder in mapper class. the child node act as root Element

XML to TEXT

2014-01-08 Thread Ranjini Rathinam
= new Job(conf, XML to Text); job.setJarByClass(MainXml.class); // job.setJobName(XML to Text); FileInputFormat.addInputPath(job, new Path(args[0])); // FileOutputFormat.setOutputPath(job, new Path(args[1])); Path outPath = new Path(output

Re: XML to TEXT

2014-01-07 Thread Ranjini Rathinam
); System.exit(-1); } String output=/user/task/Sales/; Job job = new Job(conf, XML to Text); job.setJarByClass(MainXml.class); // job.setJobName(XML to Text); FileInputFormat.addInputPath(job, new Path(args[0])); // FileOutputFormat.setOutputPath(job

Re: XML to TEXT

2014-01-06 Thread Ranjini Rathinam
(Main.class); job.setJobName(XML to Text); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); job.setMapperClass(XmlToTextMapper.class); job.setNumReduceTasks(0); job.setMapOutputKeyClass

Re: XML to TEXT

2014-01-06 Thread Rajesh Nagaraju
.println(Usage: XMLtoText input path output path); System.exit(-1); } Job job = new Job(); job.setJarByClass(Main.class); job.setJobName(XML to Text); FileInputFormat.addInputPath(job, new Path(args[0

Re: XML to TEXT

2014-01-03 Thread Ranjini Rathinam
XML to text. such as your xml like this: xml namelll/name /xml you need to specify stream.recordreader.begin and stream.recordreader.end in the Configuration: Configuration conf = new Configuration(); conf.set(stream.recordreader.begin, xml); conf.set(stream.recordreader.end, /xml

Re: XML to TEXT

2014-01-03 Thread Diego Gutierrez
); } Job job = new Job(); job.setJarByClass(Main.class); job.setJobName(XML to Text); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); job.setMapperClass(XmlToTextMapper.class

XML to TEXT

2014-01-02 Thread Ranjini Rathinam
Hi, Need to convert XML into text using mapreduce. I have used DOM and SAX parser. After using SAX Builder in mapper class. the child node act as root Element. While seeing in Sys out i found thar root element is taking the child element and printing. For Eg, CompEmpid100/idnameRR/name/Emp

Re: XML to TEXT

2014-01-02 Thread Azuryy Yu
Hi, you can use org.apache.hadoop.streaming.StreamInputFormat using map reduce to convert XML to text. such as your xml like this: xml namelll/name /xml you need to specify stream.recordreader.begin and stream.recordreader.end in the Configuration: Configuration conf = new Configuration