Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 .

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://873516]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2018-05-21 15:00 GMT
Find Nodes?
    Voting Booth?