yes you are right. I being the biologist do not know much about programming.

The first block of the above code you provided is just printing G explicitly in the vertices block. It could either be A, T, G or C. Secondly I also want to have their serial numbers in vertices block. i-e the first block should look like

1 G
2 G
3 G

In *edges section, like you said it is of no use to print the same pair twice. Is it possible to print the pairs once followed by the number indicating their total sum in file. Its a huge file. I have given a part of it here. For example, the *edges portion in this case should be like below where third column indicates the total sum of the pair in whole file which is 2 in this case

1 2 2
2 1 2
2 3 2
2 533 2
3 2 2
3 4 2
3 532 2

Please note that the 1st column of the input file i-e serial number pairs only with 3rd, 4th and 5th column NOT with the 6th column (which is happening in my code above)

I shall be very thankful for your guidance


In reply to Re^2: Spliting file + removing column by AG87
in thread Spliting file + removing column by AG87

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.