Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Sorting By Column

by dasgar (Priest)
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.

Replies are listed 'Best First'.
Re^3: Sorting By Column
by AppleFritter (Vicar) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1093106]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-12-14 09:04 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (385 votes). Check out past polls.