superfly512
Technical User
I'm a Perl newbie and I have a question reqarding to extracting data with a specific format. I have an example file shown below. I would like to extract the data and output with certain column field formats. How can I do this using Perl? Thanks in advance for your help!
Example input file...
----------------------
formal list ( name
FirstName "Joe"
LastName "Jackson"
Address 123 Avenue C
City, TX, Zip Frisco, TX, 75034
?pet ("dog" "cat" "fish")
FirstName "Jay"
LastName "Lin"
Address 1500 St. John Drive
City, TX, Zip Dallas, TX 75001
?Pet "cat"
?HomeOwner "own"
FirstName "Dan"
LastName "Brown"
City, TX, Zip Austin, TX 78753
?Car "Ford Focus"
FirstName "Amy"
LastName "Adam"
City, TX, Zip Austin, TX 78743
?HomeOwner "lease"
?Car "Chevy Tahoe"
FirstName "Hal"
LastName "Oakley"
City, TX, Zip Austin, TX 78731
?Pet ("fish" "dog")
?Car ("Taurus" "Tacoma")
?HomeOwner "own"
)
Example desired output...
-------------------------
FirstName LastName Pet Car HomeOwner
--------- -------- --- --- ---------
Joe Jackson "dog" "cat" "fish"
Jay Lin "cat" "own"
Dan Brown "Ford Focus"
Amy Adam "Chevy Tahoe" "lease"
Hal Oakley "dog" "fish" "Taurus" "Tacoma" "own"
Example input file...
----------------------
formal list ( name
FirstName "Joe"
LastName "Jackson"
Address 123 Avenue C
City, TX, Zip Frisco, TX, 75034
?pet ("dog" "cat" "fish")
FirstName "Jay"
LastName "Lin"
Address 1500 St. John Drive
City, TX, Zip Dallas, TX 75001
?Pet "cat"
?HomeOwner "own"
FirstName "Dan"
LastName "Brown"
City, TX, Zip Austin, TX 78753
?Car "Ford Focus"
FirstName "Amy"
LastName "Adam"
City, TX, Zip Austin, TX 78743
?HomeOwner "lease"
?Car "Chevy Tahoe"
FirstName "Hal"
LastName "Oakley"
City, TX, Zip Austin, TX 78731
?Pet ("fish" "dog")
?Car ("Taurus" "Tacoma")
?HomeOwner "own"
)
Example desired output...
-------------------------
FirstName LastName Pet Car HomeOwner
--------- -------- --- --- ---------
Joe Jackson "dog" "cat" "fish"
Jay Lin "cat" "own"
Dan Brown "Ford Focus"
Amy Adam "Chevy Tahoe" "lease"
Hal Oakley "dog" "fish" "Taurus" "Tacoma" "own"