in reply to Re: tabular format of data
in thread tabular format of data

Actually, I have stored column1 values in Arr1 and column two values in Arr2. Is it possible to represetn them in tabular format?

Replies are listed 'Best First'.
Re^3: tabular format of data
by JavaFan (Canon) on Feb 18, 2012 at 01:12 UTC
    Sure. Replace my first line with:
    my @data; foreach (my $i = 0; $i < @Arr1 && $i < @Arr2; $i++) { $data[$i] = [$Arr1[$i], $Arr2[$i]]; }
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: tabular format of data
by Anonymous Monk on Feb 18, 2012 at 01:04 UTC
    Sure, show your code
      A.txt:- A:B C:D code: # it has column1 values of txt file @a1=`cut -d":" -f1 < A.txt; # it has column2 values of txt file @a2=`cut -d":" -f2 < A.txt; I wanted to reprent the values in tabular form

        eew , you're shelling out for cut

        Here is a oneliner

        perl -F: -lane " print qq/-------/ if 1==$.; print join q/|/, @F, qq// +; print q/--/ x @F, qq//; " < infile > outfile

        more verbosely written as

        BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined($_ = <ARGV>)) { chomp $_; our(@F) = split(/:/, $_, 0); print '-------' if 1 == $.; print join('|', @F, ''); print '--' x @F, ''; }
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.