Greetings - I'm not necessarily new to bash scripting - I'm probably between beginner and intermediate, but I have something that I just cannot figure out after many attempts to find it. I have a file that is merely a list of many files, with their respective paths, and a branch path (ClearCase) that they live on. For instance, here is an example of this file:
As you can see, there are 3 instances of a file with 3 different versions depicted. Well, I need it sorted to where the end number is in order.
"sort -n" and "sort" doesn't work. The results are:
I need it to have the result like this:
How do you do that???
Moderator's Comments:
Please use code tags when posting data and code samples!
Last edited by vgersh99; 03-09-2011 at 11:46 AM..
Reason: code tags, please!
I have a list of people in a usage log and need to print the names and phone numbers of people with over 500 logins. I'd also like to display these names alphabetically.
I have their total logins set to a variable named total.
So far, I have very little in my awk script to do this:
FS=":"... (4 Replies)
Hi all.
I have 2 files like this:
f1
A 10
B 80
C 9
f2
A 11
B 700
C 10
What I want is the concatenation of the two files sorted by name (alphabetically) and size (numerically), so the result should be like this:
F3 (cat f1 f2 sorted)
A 10
A 11
B 80
B 700 (2 Replies)
I got a long list of file name.
My input:
data_1.txt
data_2.txt
data_3.txt
data_10.txt
data_21.txt
data_12.txt
data_4.txt
My desired output:
data_1.txt
data_2.txt
data_3.txt
data_4.txt
data_10.txt
data_12.txt
data_21.txt
Does anybody got idea how to archive it? (11 Replies)
Hey guys, I have a file that contains the following:
366 K
364 Q
12 UB
7 INC. P
4 Law
2 LAMB
2 High
1 QEG
1 OF
1 LC
1 B
As you can see, it's already sorted by numerical order, how do I sort it again, breaking the ties by using the alphabetical order of the second column, but... (2 Replies)
Hi,
A basic query. In the example file below, I want to sort by column 1 and then by column 2 numerically. I have tried sort -k2n,1 file1 but while this sorts the columns in the correct order, it does not sort column 2 numerically. Any help would be much appreciated. Also, if you have time to... (3 Replies)
Hello all,
I have a list of file names in a text document where each file name consists of 4 letters and 3 numbers (for example MACR119). There are 48 file names in the document (they are not in alphabetical or numerical order). I would like to reorder the list of names so that the 48th name is... (3 Replies)
I have a problem with my homework I need to create a shell script using #!bin/awk -f
the script will output the file in an alphabetical order only words and after the word is : after that a space then , then it will be numbered each character by which line its been for example
CB
92A
A... (1 Reply)
Hi.
I'm trying to sort a list of items in a file alphabetically but starting from the letter 'X'. For instance if I had the following file;
test.txt
Z
A
T
W
Y
B
S
X
I would like the output to look like;
X
Y (8 Replies)
Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine.
I have a directory that has...
backup.bk1
backup.bk100
backup.bk2
backup.bk200
backup.bk3
backup.bk300
There are a lot more files but this is shortened for the... (5 Replies)