vamsi.padakandla has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: split an xml file into pieces
by keszler (Priest) on Dec 13, 2011 at 07:54 UTC

    please provide me solution.

    No.

    You can get a solution from http://www.freelancer.com/. Here you can show us the code you've written and ask why it doesn't work; lots of people will be willing to help. We are not willing to do your work for you.

Re: split an xml file into pieces
by cavac (Prior) on Dec 13, 2011 at 09:49 UTC

    Some notes to your post:

    • Fix the formatting in your post. It's unreadable.
    • PerlMonks is not a coding service. We can help you fix bugs in your code, though.
    • If you want finished code (e.g. we do the work for you), i'm sure you'll find enough people here willing to come to a monetary arrangment.

    BREW /very/strong/coffee HTTP/1.1
    Host: goodmorning.example.com
    
    418 I'm a teapot
      here is the formatted code....
      use XML::Simple; binmode(STDOUT, ":utf8"); open (handle, "D:\\OlayNewProductCatalog_Interwoven_Products.xml"); $xml= new XML::Simple; $xdata = $xml->XMLin("D:\\OlayNewProductCatalog_Interwoven_Products.xm +l"); $data->{Product}->[0]->{ProductAttributes}; open (handle, "D:\\OlayNewProductCatalog_Interwoven_Products.xml"); $xmlstandard="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; $line1; $count=0; my @prdarry=(); my $prd; while(<handle>) { if($_ =~ /(\<Product\>)(.*)/) { print "<Product>"; print $2."\n"; $prd=$2; push(@prdarry,$2); if (/(\<SeoUrl\>)(.*)(\<\/SeoUrl\>)/) { $filename=$2; chomp($filename); $filename=~ s/\s+$//; $fname=~ s/[^[:ascii:]]//g; $filename =~ tr/ /_/; $filename =~ tr/\//_/; $fname=~ s/[^[:ascii:]]//g; $filename = "$filename".".xml"; open(FILE,"\>C:\\Users\\p.a.vamsi.krishna\\Desktop\\perl\\vams +i\\files\\$filename"); print "Created $2.xml File..... \n" if(!$?); print FILE "<Product>"; print FILE $prd."\n"."\t"; } if($_ !~ (/(\<)(.*)/)||(/(.*)(\>)/)){ #print FILE "No tags data...."; $notag=$_; print FILE $2; } if($_ =~ /(.*)(\<\/Product\>)/) { print "\n\n\n"; print FILE $1; print FILE "</Product>"; } } } close(FH); close(handle);
Re: split an xml file into pieces
by ansh batra (Friar) on Dec 13, 2011 at 09:34 UTC
    "below is the sample merged xml file."

    thanks for not posting the whole file
A reply falls below the community's threshold of quality. You may see it by logging in.