Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi Monks,

Thanks for the replies, its working when the length of record is 5

code suggested by experts

# HTML ignores the "\n", but it looks nicer in 'print'; $table="<table>\n"; for my $i(0..5) { $table .= "<tr>"; for (@values[$i*6 .. ($i*6+5)]) { # 'Array Slice' $table .= "<td>$_</td>"; } $table .= "</tr>\n"; } $table .= "</table>\n"

output displayed in table

ABC_TEK 12 DFE_YJK 24 JKL_GHY 26 HJK_YHJ 46 LKJ_UYH 29 GHK_YTH 23 GHS_JSF 34 GHJ_YJK 56 FHK_THE 25 SHJ_TRE 26 HSJ_TEH 39 SGH_YHK 66 AHJ_EGH 56 SGH_HEJ 42 HGE_THE 46 YHJ_JKL 44 HEJ_EJJ 67 JLE_EJK 89 EHJ_EJK 78 GSH_THK 43 EHJ_IKL 68 EHJ_EJK 57 EJH_EKL 69 HGJ_HJK 44

but if the size of the record increased from 5 to 6, i hope i need to change the logic from $i(0..6) and for (@values$i*7 .. ($i*7+6)), is thier any way where we can fetch each line based on line size

<code> for my $i(0..$#line) <code>

please give suggestion on this


In reply to Re^2: How to store multiples lines/records in a array by Perlseeker_1
in thread How to store multiples lines/records in a array by Perlseeker_1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (16)
    As of 2014-08-27 13:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (238 votes), past polls