110 reputation
117
bio website
location United States
age
visits member for 2 years, 2 months
seen Sep 13 '13 at 14:10

Private detective out on Coronado Island...


Nov
15
awarded  Famous Question
Oct
14
awarded  Nice Question
Sep
24
awarded  Autobiographer
Jul
2
awarded  Popular Question
Dec
11
awarded  Notable Question
Aug
4
awarded  Popular Question
Oct
26
comment Trying to sort on two fields, second then first
This got me thinking along the right lines - thanks for that. But don't you need to specify the stop point for the second -k. That is -k2,2 -k1,1 otherwise the stop point is taken as end of line?
Oct
26
comment Trying to sort on two fields, second then first
You nailed it. I had assumed (a dangerous thing to do) that specifying -k1 would mean use field 1, where the field ends at the default field separator (space). But as you clearly point out, the k option expects you to specify the start and stop points of the key, which may or may not be a single field. Your solution works perfectly, and more importantly, I am clear on why it does so. Many thanks.
Oct
26
awarded  Supporter
Oct
26
accepted Trying to sort on two fields, second then first
Oct
24
asked Trying to sort on two fields, second then first
Oct
8
awarded  Scholar
Oct
8
comment Reformatting a large number of XML files
This looks like a good approach if I should need to do more complex manipulation in the future. Thanks for the response.
Oct
8
comment Reformatting a large number of XML files
I just ran this and it appears to work a treat! Many thanks for the prompt and concise response!
Oct
8
accepted Reformatting a large number of XML files
Oct
8
awarded  Student
Oct
8
asked Reformatting a large number of XML files