Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:54:44+00:00 2026-05-10T18:54:44+00:00

In my code, I want to view all data from a CSV in table

  • 0

In my code, I want to view all data from a CSV in table form, but it only displays the last line. How about lines 1 and 2? Here’s the data:

1,HF6,08-Oct-08,34:22:13,df,jhj,fh,fh,ffgh,gh,g,rt,ffgsaf,asdf,dd,yoawa,DWP,tester,Pattern 2,hf35,08-Oct-08,34:12:13,dg,jh,fh,fgh,fgh,gh,gfh,re,fsaf,asdf,dd,yokogawa,DWP,DWP,Pattern 3,hf35,08-Oct-08,31:22:03,dg,jh,fh,fgh,gh,gh,gh,rte,ffgsaf,asdf,dfffd,yokogawa,DWP,DWP,ghh 

Here’s the code:

#! /usr/bin/perl print 'Content-type:text/html\r\n\r\n'; use CGI qw(:standard); use strict; use warnings;  my $line; my $file; my ($f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$f10,$f11,$f12,$f13,$f14,$f15,$f16,$f17,$f18,$f19);  $file='MyFile.txt'; open(F,$file)||die('Could not open $file'); while ($line=<F>) {  ($f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$f10,$f11,$f12,$f13,$f14,$f15,$f16,$f17,$f18,$f19)= split ',',$line;  }  close(F);  print '<HTML>'; print '<head>'; print '<body bgcolor='#4682B4'>'; print '<title>FUSION SHIFT REPORT</title>'; print '<div align='left'>'; print '<TABLE CELLPADDING='1' CELLSPACING='1' BORDER='1' bordercolor=black width='100%'>'; print '<TR>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>RECORD No.</td>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>TESTER No.</td>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>DATE</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>TIME</td>'; print '<td width='11%'bgcolor='#00ff00'><font size='2'>DEVICE NAME</td>'; print '<td bgcolor='#00ff00'><font size='2'>TEST PROGRAM</td>'; print '<td bgcolor='#00ff00'><font size='2'>DEVICE FAMILY</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>SMSLOT</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>DIE LOT</td>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>LOADBOARD</td>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>TESTER </td>'; print '<td width='12%'bgcolor='#00ff00'><font size='2'>SERIAL NUMBER</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>TESTER CONFIG</td>'; print '<td width='11%'bgcolor='#00ff00'><font size='2'>SMSLOT</td>'; print '<td bgcolor='#00ff00'><font size='2'>PACKAGE</td>'; print '<td bgcolor='#00ff00'><font size='2'>SOCKET</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>ROOT CAUSE 1</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>ROOT CAUSE 2</td>'; print '<td width='13%'bgcolor='#00ff00'><font size='2'>ROOT CAUSE 3</td>'; print '</tr>'; print '<TR>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f1</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f2</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f3</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f4</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f5</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f6</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f7</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f8</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f9</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f10</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f11</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f12</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f13</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f14</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f15</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f16</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f17</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f18</TD>'; print '<TD bgcolor='#ADD8E6'><font size='2'>$f19</TD>'; print '</tr>';  print '</TABLE>';  print '</body>'; print '<html>'; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:54:44+00:00Added an answer on May 10, 2026 at 6:54 pm

    HTML::Template would make your life a lot easier. Here’s my go with a cut-down template.

    #!/usr/local/bin/perl  use strict; use warnings;  use HTML::Template;  my @table; while (my $line = <DATA>){     chomp $line;     my @row = map{{cell => $_}} split(/,/, $line);     push @table, {row => \@row}; }  my $tmpl = HTML::Template->new(scalarref => \get_tmpl()); $tmpl->param(table => \@table); print $tmpl->output;  sub get_tmpl{     return <<TMPL <html> <TMPL_LOOP table> <tr> <TMPL_LOOP row> <td><TMPL_VAR cell></td></TMPL_LOOP> </tr></TMPL_LOOP> </html> TMPL }  __DATA__ 1,HF6,08-Oct-08,34:22:13,df,jhj,fh,fh,ffgh,gh,g,rt,ffgsaf,asdf,dd,yoawa,DWP,tester,Pattern 2,hf35,08-Oct-08,34:12:13,dg,jh,fh,fgh,fgh,gh,gfh,re,fsaf,asdf,dd,yokogawa,DWP,DWP,Pattern 3,hf35,08-Oct-08,31:22:03,dg,jh,fh,fgh,gh,gh,gh,rte,ffgsaf,asdf,dfffd,yokogawa,DWP,DWP,ghh 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer One downside is that you would break the chained assignment… May 11, 2026 at 11:49 am
  • added an answer Option One: This message is often due to an IIS… May 11, 2026 at 11:49 am
  • added an answer Your setting of Button.Click isn't assigning the event handler to… May 11, 2026 at 11:49 am

Related Questions

In my code, I want to view all data from a CSV in table
I want to capture the screen in my code to get an image -
I'd like to have comments in my code, but I want them to be
I want to offload a block of code in my main process to child
I want to see the stack trace in any function of my code, so
I created a grid in procedural code on my WPF page. Now I want
In my code, I am creating a collection of objects which will be accessed
In my code segment, when I script the file name, it gives me a
In my code attached below, I'm trying to upload a file via ASP.NET. I
In my code behind I wire up my events like so: protected override void

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.