Hello Cristoforo,

I am trying to read n number of *.txt files as argument inputs. Each file contains infinite n number of lines in the file. I want to extract the the 4th element of each line. Each element of each line is separated with a column ":".

Line example:

Line_1:Line_1_1:Line_1_2:Line_1_3:Line_1_4

After collecting each element from each line I want to put them on an array so I am able to manipulate the values of each element.

The reason that I am using array of arrays is that I do not know the number of *.txt files that I am going to use.

As a second step I am trying to print the collected values based on order of the files separated with a space in between.

Sample of the expected output:

Line_1_3 Line_3_3 Line_4_3 Line_2_3 Line_5_3 Line_6_3 Line_7_3

Each column represents the *.txt file that was loaded. For example if we had loaded the sample.txt it would be column 1, sample_2.txt would be column 2 and sample_3.txt would be column 3.

I hope this explains more and produces less confusion.

Thanks for your time and effort to assist me.

Seeking for Perl wisdom...on the process...not there...yet!

In reply to Re^4: How to concatenate a generic array of arrays and an array of hashes by thanos1983
in thread How to concatenate a generic array of arrays and an array of hashes by thanos1983

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.