Hi Aaron,

Thanks for the reply. I tried your suggestion, but it was not working as I found that there was repeats in the second column (frequency) of my input file. So, I changed the format of first column of output by concatenating the tags to the end. In that way, it looks unique. Now, I would like to sort on the first column of my output. I did create another hash to make it work. So far it is not successful. The codes that I changed are below. Any suggestions will be helpful

while (my $line=<$FILE1>) { chomp $line; $line=~s/\t/,/g; my @columns=split(/,/, $line); my $tags=$columns[0]; #$tag{$columns[0]}=\@columns; $tag{$tags}=$line; } foreach my $tags (keys %tag){ my $header; my $range=500000; my @columns=split(/,/,$tag{$tags}); $tags=$columns[0]; my $freq=$columns[1]; my $random_number=int(rand($range)); $header=">HWTI_".$freq."_".$random_number.$tags; $header=~tr/"//d; my $printline=$tag{$tags}; $printline=$header.",".$printline; print $FILE2 "$printline\n"; }

In reply to Re^2: Sorting issue by bluray
in thread Sorting issue by bluray

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.