CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Hash to CSV

 



logged
New User

Jun 22, 2017, 7:33 AM

Post #1 of 5 (1266 views)
Hash to CSV Can't Post

I would like to get a CSV file from this hash:

Code
'TREE' => { 
'ID' => '12',
'TYPE' => 'tree',
},
'CAR' => {
'ID' => '15',
'TYPE' => 'car',
},


The CSV files should look like this:
12_tree.csv
15_car.csv

Could somebody tell me how to do that? :)

Thank you for helping me Wink


FishMonger
Veteran / Moderator

Jun 22, 2017, 7:41 AM

Post #2 of 5 (1264 views)
Re: [logged] Hash to CSV [In reply to] Can't Post


Quote
The CSV files should look like this:
12_tree.csv
15_car.csv


Is that supposed to be the contents of the csv file, or the filenames?


logged
New User

Jun 22, 2017, 7:44 AM

Post #3 of 5 (1261 views)
Re: [FishMonger] Hash to CSV [In reply to] Can't Post

It should just be the file name:)


FishMonger
Veteran / Moderator

Jun 22, 2017, 7:49 AM

Post #4 of 5 (1257 views)
Re: [logged] Hash to CSV [In reply to] Can't Post

This looks like your class homework assignment.

What have you tried?

What errors/warnings are you receiving?

What should the contents look like?

How does your output differ from what you expect?


logged
New User

Jun 22, 2017, 8:06 AM

Post #5 of 5 (1255 views)
Re: [FishMonger] Hash to CSV [In reply to] Can't Post

Not really im just new in perl.
I created a foreach and it worked fine.

I just wrote car and tree cause of data protection....

but thanks for you help...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives