Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Text File Parsing

by biohisham (Priest)
on Nov 24, 2010 at 18:12 UTC ( #873516=note: print w/ replies, xml ) Need Help??


in reply to Text File Parsing

Data Dumper to visualize your data structures, Tutorials->References-> particularly the topics on hashes of arrays (HoAs), The split function and Text::Table to format your textual data are some of the things you can look into to get this job done...

The general steps involved can be as follow:

  1. loop through your data file.
  2. split each line into a key and a value.
  3. push into the HoA the values referenced by the key.
  4. Loop through your HoA to print the lines or use Text::Table to align table columns neatly
You may also need to deal with missing values and make sure that all your records are five-attributes long...



Excellence is an Endeavor of Persistence. A Year-Old Monk :D .


Comment on Re: Text File Parsing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2015-07-01 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls