CSharma has asked for the wisdom of the Perl Monks concerning the following question:
Here's the hash which I've read from json file.foreach my $line (@{$offers->{'offers'}{'offer'}}) { foreach my $row (sort keys %$line) { print $line->{$row} . "\t"; } print "\n"; }
$VAR1 = { 'offers' => { 'offer' => [ { 'originalPrice' => {}, 'categoryId' => '25000800', 'sku' => 'PBSRW21', 'shipAmount' => { 'integral' => + '100000100', 'value' => '$ +1000001.00' }, 'merchantProductId' => '0081383 +91', 'revType' => '2', 'url' => { 'value' => 'http://r +d.bizrate.com/rd?t=https%3A%2F%2Fwww.acitydiscount.com%2FJohn-Boos-21 +-Wall-Mounted-Solid-Sorting-Shelf-18-Gauge-Stainless-PB-SRW-21.0.1383 +91.1.1.htm%3Futm_source%3Dbizrate%26utm_medium%3Dcse%26utm_campaign%3 +Dcse_biz%26ppcid%3D8%26link%3D13170103&mid=91353&cat_id=25000800&atom +=10704&prod_id=&oid=4608507152&pos=1&b_id=18&bid_type=0&bamt=a5fedf14 +fd8fec0d&cobrand=1&ppr=85e317571cc20ee0&rf=af1&af_assettype_id=12&af_ +creative_id=2932&af_id=[PUBLISHER_ID]&af_placement_id=1&dv=5786a95dec +b116ac2d79e70c5ddae351' }, 'id' => '4608507152', 'atomId' => '10704', 'images' => { 'image' => [ { 'y +size' => '400', 'x +size' => '400', 'v +alue' => 'http://d1-pub.bizrate.com/resize?sq=400&uid=4608507152' } ] }, 'rawUrl' => 'https://www.acityd +iscount.com/John-Boos-21-Wall-Mounted-Solid-Sorting-Shelf-18-Gauge-St +ainless-PB-SRW-21.0.138391.1.1.htm?utm_source=bizrate&utm_medium=cse& +utm_campaign=cse_biz&ppcid=8&link=13170103', 'shipType' => 'UNKNOWN', 'stock' => 'IN', 'description' => 'John Boos - P +B-SRW-21 Weight 5 lbs. Width 21 in. Depth 18 in. Height 16 in. Rating +s: NSF. John Boos 21 Wall Mounted Solid Sorting Shelf 18 Gauge Stainl +ess - in Shelving, Wall at ACityDiscount', 'merchantId' => '91353', 'brandId' => '271910', 'manufacturer' => 'John Boos', 'type' => 'OFFER', 'title' => 'John Boos 21 Wall M +ounted Solid Sorting Shelf 18 Gauge Stainless - PB-SRW-21', 'price' => { 'integral' => '956 +3', 'value' => '$95.63 +' } }, { 'originalPrice' => {}, 'categoryId' => '25000800', 'sku' => 'DT6R23X', 'shipAmount' => { 'integral' => + '100000100', 'value' => '$ +1000001.00' }, 'merchantProductId' => '0080147 +82', 'revType' => '2', 'url' => { 'value' => 'http://r +d.bizrate.com/rd?t=https%3A%2F%2Fwww.acitydiscount.com%2FAdvance-Tabc +o-62-Wall-Mounted-Tubular-Sorting-Shelf-Stainless-Knock-Down-DT-6R-23 +-X.0.14782.1.1.htm%3Futm_source%3Dbizrate%26utm_medium%3Dcse%26utm_ca +mpaign%3Dcse_biz%26ppcid%3D8%26link%3D13170103&mid=91353&cat_id=25000 +800&atom=10704&prod_id=&oid=5266795020&pos=1&b_id=18&bid_type=0&bamt= +a5fedf14fd8fec0d&cobrand=1&ppr=d3a45a91cc13e426&rf=af1&af_assettype_i +d=12&af_creative_id=2932&af_id=[PUBLISHER_ID]&af_placement_id=1&dv=57 +86a95decb116ac2d79e70c5ddae351' }, 'id' => '5266795020', 'atomId' => '10704', 'images' => { 'image' => [ { 'y +size' => '400', 'x +size' => '400', 'v +alue' => 'http://d1-pub.bizrate.com/resize?sq=400&uid=5266795020' } ] }, 'rawUrl' => 'https://www.acityd +iscount.com/Advance-Tabco-62-Wall-Mounted-Tubular-Sorting-Shelf-Stain +less-Knock-Down-DT-6R-23-X.0.14782.1.1.htm?utm_source=bizrate&utm_med +ium=cse&utm_campaign=cse_biz&ppcid=8&link=13170103', 'shipType' => 'UNKNOWN', 'stock' => 'IN', 'description' => 'Advance Tabco + - DT-6R-23-X,DT-6R-23 Weight 30 lbs. Width 18 in. Depth 62 in. Heigh +t 11.25 in. Ratings: NSF. Advance Tabco 62 Wall Mounted Tubular Sorti +ng Shelf Stainless Knock Down - in Shelving, Wall at ACityDiscount', 'merchantId' => '91353', 'brandId' => '41378', 'manufacturer' => 'Advance Tabc +o', 'type' => 'OFFER', 'title' => 'Advance Tabco 62 Wa +ll Mounted Tubular Sorting Shelf Stainless Knock Down - DT-6R-23-X', 'price' => { 'integral' => '380 +19', 'value' => '$380.1 +9' } } ] } };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to write complete hash into CSV?
by Eily (Monsignor) on Jun 07, 2016 at 08:06 UTC | |
Re: How to write complete hash into CSV?
by GotToBTru (Prior) on Jun 07, 2016 at 12:01 UTC | |
Re: How to write complete hash into CSV?
by Marshall (Canon) on Jun 07, 2016 at 12:38 UTC | |
Re: How to write complete hash into CSV?
by anonymized user 468275 (Curate) on Jun 08, 2016 at 13:40 UTC | |
Re: How to write complete hash into CSV?
by mhearse (Chaplain) on Jun 08, 2016 at 21:00 UTC |