Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://873516]
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: (2)
As of 2015-11-28 11:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls