Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Sorting By Column

by dasgar (Curate)
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
Replies are listed 'Best First'.
Re^3: Sorting By Column
by AppleFritter (Priest) 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2015-10-04 21:43 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (105 votes), past polls