Sponsored Content
Full Discussion: Need to sort file
Top Forums Shell Programming and Scripting Need to sort file Post 302306901 by learnerlearner on Tuesday 14th of April 2009 07:36:17 AM
Old 04-14-2009
Data Need to sort file

Hi,
I have a file with the list of RPMs in the following format
unix-abc-bin-1.27.1-006901
unix-abc-cfg-1.27.1-006901
unix-xyz-bin-1.27.1-006901
unix-abc-bin-1.27.2-006902
unix-xyz-bin-1.27.2-006902
unix-xyz-img-1.27.2-006902

I need the output as shown below
unix-abc-bin-1.27.2-006902
unix-abc-cfg-1.27.1-006901
unix-xyz-bin-1.27.2-006902
unix-xyz-img-1.27.2-006902

Could anyone please help me out in this ? I am a newbee to scripting

Thanks in Advance...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to sort a file

Hi, i want to sort a file by column 2, 3, 10 and 4(in this order), can anybody help me? thanks a lot. (2 Replies)
Discussion started by: tao
2 Replies

2. Shell Programming and Scripting

Sort a particular column in a file

Dear All, Good day. Here i am facing some problem like below. file contains 12345 0001 090112 14385 0001 090112 13255 0001 090112 11345 0001 090112 .... I want to sort ascending according to the first column. What will be the shell script. (4 Replies)
Discussion started by: saifurshaon
4 Replies

3. Shell Programming and Scripting

q's on file sort

I have a file below which has a list of users and roles with each row having unique combination of users and roles. USER1 ROLE1 USER1 ROLE2 USER2 USER3 ROLE1 USER3 ROLE2 USER3 ROLE3 USER4 ROLE2 .... .... I am trying to create a script which sorts the above file to have all the... (4 Replies)
Discussion started by: stevefox
4 Replies

4. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

5. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

6. Shell Programming and Scripting

Unix Scripting : Sort a Portion of a File and not the complete file

Need to sort a portion of a file in a Alphabetical Order. Example : The user adam is not sorted and the user should get sorted. I don't want the complete file to get sorted. Currently All_users.txt contains the following lines. ############## # ARS USERS ############## mike, Mike... (6 Replies)
Discussion started by: evrurs
6 Replies

7. Shell Programming and Scripting

Help with sort word and general numeric sort at the same time

Input file: 100%ABC2 3.44E-12 USA A2M%H02579 0E0 UK 100%ABC2 5.34E-8 UK 100%ABC2 3.25E-12 USA A2M%H02579 5E-45 UK Output file: 100%ABC2 3.44E-12 USA 100%ABC2 3.25E-12 USA 100%ABC2 5.34E-8 UK A2M%H02579 0E0 UK A2M%H02579 5E-45 UK Code try: sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. AIX

Sort file

as friends can only Sort this file with awk from low to high from position 3 to 9 bone this: 0003344 A70003344prueba1 A70003347prueba1 A70003345prueba1 A70003349prueba1 A70003343prueba1 A70003342prueba1 (4 Replies)
Discussion started by: tricampeon81
4 Replies

10. UNIX for Beginners Questions & Answers

How to align/sort the column pairs of an csv file, based on keyword word specified in another file?

I have a csv file as shown below, xop_thy 80 avr_njk 50 str_nyu 60 avr_irt 70 str_nhj 60 avr_ngt 50 str_tgt 80 xop_nmg 50 xop_nth 40 cyv_gty 40 cop_thl 40 vir_tyk 80 vir_plo 20 vir_thk 40 ijk_yuc 70 cop_thy 70 ijk_yuc 80 irt_hgt 80 I need to align/sort the csv file based... (7 Replies)
Discussion started by: dineshkumarsrk
7 Replies
readproctitle(8)					      System Manager's Manual						  readproctitle(8)

NAME
readproctitle - maintains an automatically rotated log in memory for inspection by ps(1). readproctitle is available in daemontools 0.75 and above. SYNOPSIS
readproctitle L D DESCRIPTION
L consists of any number of arguments. D is one argument consisting of at least five dots. readproctitle reads data into the end of D, shifting D to the left to make room. This means that the most recent data is visible to process-listing tools such as ps(1). readproctitle always leaves three dots at the left of D. For example, if readproctitle io errors: .................... reads the data fatal error xyz warning abc then its command-line arguments change to readproctitle io errors: ... xyz!warning abc! with a newline character in place of each !. Process-listing tools typically show the newline character as ? or . readproctitle exits when it reaches the end of input. Beware that most implementations of ps(1) have small argument-length limits. These limits apply to the total length of readproctitle L D. I have not seen a system with a limit below 512 bytes. SEE ALSO
supervise(8), svc(8), svok(8), svstat(8), svscanboot(8), svscan(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), tai64nlocal(8), setu- idgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8), ps(1) http://cr.yp.to/daemontools.html http://cr.yp.to/slashcommand.html readproctitle(8)
All times are GMT -4. The time now is 08:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy