I want to insert a header to the output file

Just print it :)  — before printing the rows with the numbers:

print "my header ...\n"; while (<FILE>){ ...
I want the results to be printed in a new file.

Either redirect the program's output (stdout) to a file using the shell, or explicitly open another file for output, and then print to that file handle:

... open OUTFILE, ">", "outfile.txt" or die $!; print OUTFILE "my header ...\n"; while (<FILE>){ print OUTFILE join("\t", map { $_ * $df * 50 } split /\t/), "\n"; }
it has to be 7 X 10. how should i set values to 7 columns X 10 rows ?

There isn't really anything to "set".  If you print 10 lines (rows) with each containing 7 tab separated values, you're done, essentially... i.e. the file will have 7 columns X 10 rows.  This would happen without further ado (with the code we have so far), provided the input file also has the same dimensions (which is seems to have (at least the columns), judging by your sample data).


In reply to Re^7: handling tab delimited files by almut
in thread handling tab delimited files by shaludr

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.