Problem in Hash formatted output


#1

Hi All,

I have an Array Like this

@output=[{“accounts”=>[“id”, “group_id”, “company_id”, “number”, “name”,
“opening_balance”, “description”, “editable”, “created_at”,
“updated_at”, “source_account”, “deleted_status”, “alias”,
“closing_balance”, “flag”]},

{“blogs”=>[“id”, “category_id”, “title”, “content”, “views”,
“created_at”, “updated_at”]},

{“categories”=>[“id”, “name”]}
{“clients”=>[“id”, “first_name”, “last_name”, “street1”, “street2”,
“city”, “state”, “zip”, “country”, “phone”, “fax”, “email”, “website”,
“flag”, “created_at”, “updated_at”]},

{“companies”=>[“id”, “client_id”, “name”, “street1”, “street2”, “city”,
“state”, “zip”, “country”, “phone”, “fax”, “email”, “website”, “flag”,
“created_at”, “updated_at”, “business_number”, “year_end_date”,
“net_days”, “selected_province”, “tax”, “plan_name”, “error_display”,
“logo_display_flag”, “business_type”, “user_id”]},

{“company_details”=>[“id”, “content_type”, “filename”, “size”,
“parent_id”, “thumbnail”, “width”, “height”, “db_file_id”,
“attachable_type”, “attachable_id”]},

{“contacts”=>[“id”, “company_id”, “company_name”, “first_name”,
“last_name”, “title”, “street1”, “street2”, “city”, “state”, “zip”,
“country”, “phone”, “email”, “fax”, “website”, “contact_type”,
“created_at”, “updated_at”, “account_id”, “flag”]},

{“countries”=>[“id”, “name”, “code”]}]

This is my array. I want to get exactly like this Output format

OUTPUT:

01.accounts
id
group_id
company_id
number
name
opening_balance
description
editable
created_at
updated_at
source_account
deleted_status
alias
closing_balance
flag

02.blogs
id
category_id
title
content
views
created_at
updated_at

AND So ON

Please provide a code for it

Thanks,
P.Raveendran


#2

On 29.11.2008 11:45, jazzez ravi wrote:

I have an Array Like this

This is my array. I want to get exactly like this Output format

Please provide a code for it

Another attempt to abuse the community to write code for free. For this
to work you should provide a much more interesting problem than
formatting output of a nested data structure.

Alternative show the code you have got so far and we’ll be happily
helping out where you have problems.

Regards

robert


#3

jazzez ravi wrote:

Hi All,

I have an Array Like this
snip
This is my array. I want to get exactly like this Output format
snip
Please provide a code for it

There is a difference between help and solutions. Help you might get
for free here (depends a lot on you, e.g. attitude, proper information
etc.), but if you want solutions, go and get some contractor. That’s
what you pay for.

Regards
Stefan


#4

Stefan R. wrote:

jazzez ravi wrote:

Hi All,

I have an Array Like this
snip
This is my array. I want to get exactly like this Output format
snip
Please provide a code for it

There is a difference between help and solutions. Help you might get
for free here (depends a lot on you, e.g. attitude, proper information
etc.), but if you want solutions, go and get some contractor. That’s
what you pay for.

2 jazzez ravi =>
agreed :slight_smile:

2 Stefan R. =>
what for do you need this
for debugging reason you may use ‘pp’
eg. require ‘pp’; pp @output

else you have to write your own method if you need this being
implemented
a lot of samples exist in the network, just carefully dig


#5

Hi All,

Thanks for your kind information. I requested to my client for provide a
full code to me. And also suggest the output format like this,

accounts=[“id”,
“group_id”,
“company_id”,
“number”,
" name",
" opening_balance",
" description",
" editable",
" updated_at",
" source_account",
" deleted_status",
" alias",
" closing_balance",
" flag"]

output=[accounts,blogs]

I have only the above output format which is mentioned the Top of the
Post.Thats why asking suggestion from U Guys. Anyway let u know after
getting info from My client.

Thanks,
P.Raveendran