Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Sorting By Column

by dasgar (Deacon)
on Jul 10, 2014 at 19:02 UTC ( #1093106=note: print w/ replies, xml ) Need Help??


in reply to Re: Sorting By Column
in thread Sorting By Column

I could be wrong, but I think your while loop is going to have problems if the two specified files do not have the same number of lines. If the first file has less lines than the second file, your code won't fully process all lines in the second file. If the first file has more lines than the second file, your loop will try to read in more lines from the second file than what it has.


Comment on Re^2: Sorting By Column
Re^3: Sorting By Column
by AppleFritter (Curate) on Jul 10, 2014 at 19:05 UTC
    You're right -- based on the sample data the OP shared, I assumed that both files would have the same number of lines. Thanks for pointing this out, I should have mentioned it explicitely.

      Thanks AppleFritter!

      The original file is combined such as what I'm trying to achieve so for every key 1 there is a key 2.

      This should work fine and I will work with it (or a variation thereof).

      The sample provided was just a snipping from the original file as an example of what I'm working with.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1093106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-10-31 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (223 votes), past polls