Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Parsing issues

by NetWallah (Abbot)
on Nov 16, 2012 at 05:23 UTC ( #1004125=note: print w/ replies, xml ) Need Help??


in reply to Parsing issues

The code below may give you some hints on how to process your data:

use strict; use warnings; my @differenthtml; $/="htmlpagemark"; while (<DATA>){ chomp; next if $_ eq "htmlpagemark"; next unless length($_) > 0; push @differenthtml, $_; } for my $item (0..$#differenthtml){ print "===Item $item ==\n$differenthtml[$item]\n" } __DATA__ htmlpagemark http://finance.yahoo.com #/q/hp?s=%5EDJI&d=10&e=8&f=20 +12&g=d&a=0&b=2&c=199 +2&z=66&y=5214 # <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" #"http://www.w3.o +rg/TR/html4/strict.dtd"> # It also consists of a lot of more text before the next #"h t m l p a + g e m a r k" htmlpagemark http://another/URL More text #sorry if this question reveals to be noobish and simple #but i have n +o idea how to solve this issue + the= #contents of a read text file END

             "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius


Comment on Re: Parsing issues
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004125]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2014-08-20 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (115 votes), past polls