http://www.perlmonks.org?node_id=1003419


in reply to Re^3: Sorting one column of results
in thread Sorting one column of results

hello choroba, Thank you for replying, the coding works however the output is all in one line, even though the split function is in the coding? not sure why? and is it possible to only print the following (as opposed to the entire original file?) print OUT "$text[10]\n$text[11]\nQuantity:$text[12]\n\n$text[16]\n$text[17]\n$text[18]\n$text[19]\n$text[20]\n$text[21]\n$text[22]\n$text[23]\n\n\n"; Thank you so much :)!

Replies are listed 'Best First'.
Re^5: Sorting one column of results
by Anonymous Monk on Nov 13, 2012 at 10:29 UTC
    for my $line (sort { $a->[10] cmp $b->[10] } @out) { printf $OUT "%s\n%s\n" . "Quantity:%s\n\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n\n", @$line[10..12], @$line[16..23]; }