Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 lurking in the Monastery: (3)
As of 2014-10-01 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls