Hi, Im sure this is a stupid question, but i cant figure out how to make it happen. Again, i stress this is not homework, but a requirement at my job. Anyways, here goes. I have an array, in it is 3 values, long ones. WHen i go to incorporate this array into my code, the output automatically goes to the next line after the value in the array, and hence messes up the output. Here is the normal output :
                      RF Block | DCCH Block | Disp Queue | RF Drop | Erl/BR |
DE-NJ-MD sites          1.40 % |    0.24 %  |    1.39%   |   2.04% |   2.35 |
PA Sites Only           1.68 % |    0.32 %  |    1.79%   |   2.09% |   2.53 |
Philadelphia Market     1.58 % |    0.29 %  |    1.65%   |   2.07% |   2.46 |
and here is the output with the array added. (i want to add the dates at the end of each row, corresponding to when the data was collected)
                      RF Block | DCCH Block | Disp Queue | RF Drop | Erl/BR |
DE-NJ-MD sites          1.40 % |    0.24 %  |    1.39%   |   2.04% |   2.35 |
 Fri Oct 13 2000 20:11:54                                              Page  1
PA Sites Only           1.68 % |    0.32 %  |    1.79%   |   2.09% |   2.53 |
 Fri Oct 13 2000 20:51:41                                              Page  1
Philadelphia Market     1.58 % |    0.29 %  |    1.65%   |   2.07% |   2.46 |
 Fri Oct 13 2000 20:59:56                                              Page  1
ir gets all fouled up. Im sure the code will be helpful, so here that is.
Note: the date array is entitled @indidate
#!/usr/local/bin/perl use strict; # Author: Dipul Patel # Nextel Philadelphia # This script takes the data for 3 markets, and compiles it on one fi +le. ###########################################33 my $time2 = scalar localtime(); my @time3 = split(/ /, $time2); my $one=$time3[1]; my $two=$time3[3]; my $three=$time3[5]; my $fileext = "$one" ."_". "$two" ."_". "$three"; open(WR, ">/usr/local/rf-north/WWW/WeeklyReports/WeeklyReports.$fileex +t"); my @files = ("/usr/local/rf-north/WWW/PHLreports/cellsight/Weekly_Repo +rts/de-nj-md\n", "/usr/local/rf-north/WWW/PHLreports/cellsight/Weekly_Reports/ +pa_only\n", "/usr/local/rf-north/WWW/PHLreports/cellsight/Weekly_Reports/ +phila_market\n"); my $file; my (@data, @lines); for $file (@files){ open (FH, $file) || die "Unable to open file $file\n"; @data = <FH>; close (FH); push (@indidate, $data[1]); push (@lines, $data[$#data]); } my $i=0; my @string =("DE-NJ-MD sites ", "PA Sites Only ", "Philadelphia Market "); printf(WR " RF Block | DCCH Block | Disp +Queue | RF Drop | Erl/BR |\n"); while($i<3){ my $line=$string[$i].@lines[$i].$indidate[$i]; printf(WR "$line"); $i++; } close (WR); undef @data;
as soon as i remove the $indidate[$i] tag, the output prints correctly, but it is essential that i have the dates there. Is there a way to remove everything except the date from each value in the array? Or to make sure there is no carriage return after the |?
Thank You
Dipul Patel

In reply to Auto Carriage Return? by ImpalaSS

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.