Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^8: perllocale weirdness, bug, or...?

by Krambambuli (Curate)
on Oct 22, 2010 at 12:20 UTC ( #866794=note: print w/replies, xml ) Need Help??


in reply to Re^7: perllocale weirdness, bug, or...?
in thread perllocale weirdness, bug, or...?

Thanks for the tip - I really hoped it might solve the issue, but unfortunately it does not.

For the file test.txt (TAB separated fields) being
a_2 2 a2 1
I still get
$ sort -k 1,1 test.txt | cut -f 1 a2 a_2
whereas when there is no second field then the result is reversed,
a_2 a2
Looks like the problem 'survives'.
---

Replies are listed 'Best First'.
Re^9: perllocale weirdness, bug, or...?
by choroba (Chancellor) on Oct 22, 2010 at 12:33 UTC
    Looks like two level sort: on the first level, it ignores the _, but if the strings are different only thanks to the underscore, it is used in the second level.
    $ echo $'a_2\t2\na2\t1' | sort -k1 a2 1 a_2 2 $ echo $'a_2\t2\na2\t1' | sort -k1,1 a2 1 a_2 2 $ echo $'a2\t2\na_2\t1' | sort -k1,1 a2 2 a_2 1 $ echo $'a2\t2\na_2\t1' | sort -k1 a_2 1 a2 2

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://866794]
help
Chatterbox?
[Corion]: marto: Redoing something on new infrastructure sounds fun. At least you can reuse your previous experience :)
[marto]: I'm looking forwads to it. The video sources are dying, and they don't have the hardware to play them back (old tape formats, not just VHS + Laserdisc etc)
[marto]: I'll be interested to see what difference in terms of file size/quality the new codecs make. I enjoy working on things like this, so that's a bonus
[Corion]: Ah, cool! So it's not an inhouse youtube but for a wider consumption
[marto]: last time it was IE6 clients, now they're on 11, so more scope there also, in terms of UI and playback
[marto]: in house as in Company network, not internet connected (power stations and the corporate HQs)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2017-07-28 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (425 votes). Check out past polls.