,p>ahh apologies, l totally understand what you mean. Here is the start of my scripy

#!/usr/bin/perl -w # ------------------------------------------------- use strict; use Getopt::Long; use Pod::Usage; use File::Spec; Getopt::Long::Configure ("bundling"); # ------------------------------------------------- my $help = 0; my $force = 0; my $verbose = 0; my $result = GetOptions( "help|h" =>\$help, "force|f"=>\$force, "verbose|v"=>\$verbose, #-------------------------------------------------- # Assign input data to an arrray #--------------------------------------------------- scalar (@ARGV) == 1 or die pod2usage(1); my $fname = $ARGV[0]; my $fnameout = $fname; $fnameout =~ s/\.\w\w\w$/_conv.csv/; # ------------------------------------------------- (-e $fname) or die "Unable to find input file: $fname\n"; (-e $fnameout and $force) and die "Output file already exisys. Use -f +to force: $fnameout\n"; my ($fin, $fout); open ($fin, "<$fname") or die "Unable to open file: $fname\n"; open ($fout, ">$fnameout") or die "Unable to open output file: $fnameo +ut\n"; my @headers = qw (Col_1 Col_3 Mean St_Dev); print $fout (join (",", @headers),"\n"); # ------------------------------------------------- # Chomp all data # ------------------------------------------------- my @data = <$fin>; # ------------------------------------------------- my $cnt = 0; foreach my $line (@data) { $cnt ++; next unless $cnt > 1; # Skip Header chomp($line); }

its just the input section, l really am stuck on how to loop over this my programmers mind is still quite novice im afraid and l am still struggling on working through loops in my mind.


In reply to Re^2: Mean and standard deviation loop by SixShot
in thread Mean and standard deviation loop by SixShot

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.