This is what i have in a file sortdata

IGOT C9.1.20.2DBSU10 - -
CVGRETesting C9.1.20.2DBSU11 - -
BalInqMail C9.1.20.2DBSU11 - -
SecScore C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU9 - -
SecScore C9.1.20.2DBSU9 - -

When i Sort i am getting


BalInqMail C9.1.20.2DBSU11 - -
CVGRETesting C9.1.20.2DBSU11 - -
IGOT C9.1.20.2DBSU10 - -
IGOT C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU9 - -
SecScore C9.1.20.2DBSU8 - -
SecScore C9.1.20.2DBSU9 - -

The Order i need is DBSU11- DBSU11-DBSU10-DBSU9-DBSU9-DBSU8-DBSU8

but i am getting only 11-11-10-8-9-8-9 Which is wrong

Hey this C9.1.20. should also be sorted I mean C9.1.20.1DBSU12 is less than C9.1.20.2DBSU1

Please help me out as soon as you can . I need it at the earliest

More info for stating the prob

Thanks for the response. This is the order I want

BalInqMail C9.1.20.2DBSU11
CVGRETesting C9.1.20.2DBSU11
IGOT C9.1.20.2DBSU10
IGOT C9.1.20.2DBSU9
SecScore C9.1.20.2DBSU9
IGOT C9.1.20.2DBSU8
SecScore C9.1.20.2DBSU8

The Scenario is like this . BalInqMail , IGOT ... are file names and belong to patch C9.1.20.2DBSU11, C9.1.20.2DBSU10 ....

Say i am installing multiple patches for an application and Say IGOT is in patch 11 and also patch 8 I want to skip patch 8 file and install only patch 11 file. I have all the program ready. My only problem is that in sorting it is comparing only only 1st num and sorting so 2 is bigger than 11 which is not what i want.

Thanks once again. Help me out plzz...

Please try following on u r data file
cat filename | sort -t " " -nrk '2.14'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.