Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: tabular format of data

by oko1 (Deacon)
on Feb 18, 2012 at 03:02 UTC ( #954688=note: print w/ replies, xml ) Need Help??


in reply to Re: tabular format of data
in thread tabular format of data

Is that the 'christ' part of your nick getting some play, Tom? :)

I think that sending the OP off to learn 'tbl' and all that other related stuff would drive him bats. He's having a hard enough time understanding how to use code tags, for Ghu's sake. I suspect 'printf' would be a bit more his speed - if he ever settles down and actually pays attention to the people's replies to his questions.

Deepak - please start paying attention to the replies that people have given. There's plenty of information here, all you would ever need to do what you've asked about. And PLEASE start using code tags: when you write your post, surround the code part - the part that you want to show in its original format - with a <c> tag above it and a </c> tag below it. Everyone, including you, will be happier if you do.

-- 
I hate storms, but calms undermine my spirits.
 -- Bernard Moitessier, "The Long Way"


Comment on Re^2: tabular format of data
Re^3: tabular format of data
by tchrist (Pilgrim) on Feb 18, 2012 at 03:21 UTC
    Is that the ‘christ’ part of your nick getting some play, Tom? :)
    Hey, it’s when I start signing with that you’ll really have to worry. 😇

    I just couldn’t help myself. His mendicant petitions were so subclubious that ... well ... er ... how ’bout I thought something simple might work better? Surely they couldn’t be worse!

    Yeah yeah, okay. You were supposed to laugh.

    But it’s true that I personally have always found tbl a lot easier than HTML tables, which are kinda nightmarish. But what do you expect? So is all markup language. I could sing you a slow song of DocBook — call it a dirge — whose lamentations would strike dumb your tongue and rip your heart asunder, and you would claw out your eyes to save them from every having to look at it again.

    And it’s coming soon to a bookstore near you. 🙆

    ++tol

      please correct me if I am wrong --- I used the given code details== my $width = length $data[0][0]; # Assume they're all the same length +. my $Width = @{$data[0]}; my $divider = "-" x (($width + 1) * $Width); my $topline = $divider x 2; chop $topline; say $topline; foreach my $line (@data) { print "$_|" for @$line; say "\n$divider"; } ======================= i used the above code but i got an error message saying "cann't call "say " without a package or object reference. Also, in the above code, where i will use the .. detai ============ Please help

      In that sign you will conquer, if your publisher can ever get it to render!

Re^3: tabular format of data
by deepak_4682us on Feb 18, 2012 at 03:39 UTC
    please correct me if I am wrong --- I used the given code details== my $width = length $data[0][0]; # Assume they're all the same length +. my $Width = @{$data[0]}; my $divider = "-" x (($width + 1) * $Width); my $topline = $divider x 2; chop $topline; say $topline; foreach my $line (@data) { print "$_|" for @$line; say "\n$divider"; } ======================= i used the above code but i got an error message saying "cann't call "say " without a package or object reference. Also, in the above code, where i will use the .. detai ============ Please help

      Hey man if you really want an answer for your query please put your code inside the "code" block not inside "paragraph". Re post your last node.

      code:-- a.txtchas below details:-- ABC:CDE DEF:GGFF in a.pl:-- @a1=`cut -d":" -f1 < a.txt; a2=`cut -d":" -f2 < a.txt; This much i have done in my code. Can u pls help me how can i arrange in a tabular format
      Also, I have used the recommned code in my code:-- my @data; foreach (my $i = 0; $i < @Arr1 && $i < @Arr2; $i++) { $data$i = [$Arr1$i, $Arr2$i]; } my $width = length $data[0][0]; # Assume they're all the same length +. my $Width = @{$data[0]}; my $divider = "-" x (($width + 1) * $Width); my $topline = $divider x 2; chop $topline; say $topline; foreach my $line (@data) { print "$_|" for @$line; say "\n$divider"; } ================ but its printing the result as : A |B |C |D ------------- pls suggest
      can any one pls help me in last step:-- I used the above code, its printing as A |B |C instead of A|B| |C|D| ------

        Dude, seriously... Switch to decaf. Now.

        HTH,

        planetscape

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://954688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2014-09-18 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (106 votes), past polls