Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl: Extracting specific text from a .txt file and outputting into a new format

by sundialsvc4 (Monsignor)
on Nov 19, 2010 at 14:27 UTC ( #872507=note: print w/ replies, xml ) Need Help??


in reply to Perl: Extracting specific text from a .txt file and outputting into a new format

It might be useful to apply “state machine” logic here.   Or even to approach the parsing task using a tool such as Parse::RecDescent (which has become a very well-known tool to me as of late...).

Basically, it seems that the best way to describe this problem is that “the proper interpretation of what is in front of me now, depends upon what surrounds it; on what has come before.”   That contextual knowledge can be represented in a “state.”   And, the greater task might well be expressable using a grammar, hence my suggestion of a true parser.


Comment on Re: Perl: Extracting specific text from a .txt file and outputting into a new format

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-07-24 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (159 votes), past polls