06-20-2003
How to sort multiples columns of a file?
Hi all!
here is the file i am trying to sort :
GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:04
GREIMBAJ00;PER_COT;Loader.sh;2003/06/13;17:04:16
GREIMBAJ00;PER_COT;Traitement.sh;2003/06/13;17:04:18
GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:11
GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:06
GREIMBAJ00;PER_COT;Traitement.sh;2003/06/13;17:04:25
GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:18
GREIMBAJ00;PER_COT;Loader.sh;2003/06/13;17:04:21
GREIMBAJ01;BAN_CAV;Traitement.sh;2003/06/13;17:04:35
GREIMBAJ01;BAN_CAV;Traitement.sh;2003/06/13;17:05:03
GREIMBAJ02;BAN_PAK;Traitement.sh;2003/06/16;09:19:56
GREIMBAJ02;BAN_PAK;Delete.sh;2003/06/16;09:20:03
GREIMBAJ02;BAN_PAK;Delete.sh;2003/06/16;09:20:05
GREIMBAJ02;BAN_PAK;Traitement.sh;2003/06/16;09:20:00
GREIMBAJ04;BAN_RAV;Traitement.sh;2003/06/16;09:27:39
GREIMBAJ04;BAN_LIE;Pretraitement.sh;2003/06/16;09:27:34
GREIMBAJ04;BAN_LIE;Pretraitement.sh;2003/06/16;09:27:37
GREIMBAJ04;BAN_RAV;Traitement.sh;2003/06/16;09:28:23
...
As you can all notice...it is a real mess....
I aim to obtain the following result
:
GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:04
GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:06
GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:11
GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:18
GREIMBAJ00;PER_COT;Loader.sh;2003/06/13;17:04:16
GREIMBAJ00;PER_COT;Loader.sh;2003/06/13;17:04:21
GREIMBAJ00;PER_COT;Traitement.sh;2003/06/13;17:04:25
GREIMBAJ00;PER_COT;Traitement.sh;2003/06/13;17:04:18
GREIMBAJ01;BAN_CAV;Traitement.sh;2003/06/13;17:04:35
GREIMBAJ01;BAN_CAV;Traitement.sh;2003/06/13;17:05:03
GREIMBAJ02;BAN_PAK;Traitement.sh;2003/06/16;09:19:56
GREIMBAJ02;BAN_PAK;Traitement.sh;2003/06/16;09:20:00
GREIMBAJ02;BAN_PAK;Delete.sh;2003/06/16;09:20:03
GREIMBAJ02;BAN_PAK;Delete.sh;2003/06/16;09:20:05
GREIMBAJ04;BAN_LIE;Pretraitement.sh;2003/06/16;09:27:34
GREIMBAJ04;BAN_LIE;Pretraitement.sh;2003/06/16;09:27:37
GREIMBAJ04;BAN_RAV;Traitement.sh;2003/06/16;09:28:23
GREIMBAJ04;BAN_RAV;Traitement.sh;2003/06/16;09:27:39
I guess i must use the "sort" command...but it really seems very tricky...
Can someone help me on this one?
thanks!
Regards,
Howard
Last edited by HowardIsHigh; 06-20-2003 at 09:53 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I've got this question about using cp for copying multiples files from the same source directory to another directory, considering that my working directory ain't the same of the source directory.
Let me give you a simple example what I'm talking about:
Suppose the following files... (2 Replies)
Discussion started by: chapeupreto
2 Replies
2. Programming
1. Why are the pointers' addresses every 32 ?
2. Am I correct in stating that memset is writing to memory that is not allocated to any of the 3 pointers ? Is it writing to memory in between the pointers ?
3. Are the 3 pointers contiguous in memory ?
4. I only allocated 10 bytes for each pointer.... (5 Replies)
Discussion started by: cyler
5 Replies
3. Shell Programming and Scripting
Hi,
IS possible in ksh to make multiples menus?
For example:
My menu.
1)Option1
1.1)Option1.1
2.3)Option1.2
2)Option2
2.1)Option2.1
.
.
.
x)Exit
I've tried with case but no success.
Thanks in advance. (3 Replies)
Discussion started by: iga3725
3 Replies
4. Shell Programming and Scripting
Hi
I have this string with 3 seds..
cat /tmp/roletmp|sed "s/$role2del//" | sed "s/,,/,/" |sed "s/^,//" |sed 's/,$//'
How can I join these 3 seds in one?
regards
Israel. (3 Replies)
Discussion started by: iga3725
3 Replies
5. Programming
Hi Guys,
I wonder how can I determine when a given number is a multiple of another one in java. Let's say if I have 27 how can I determine whether is multiple of 5 using java programming. Thanks. (1 Reply)
Discussion started by: arizah
1 Replies
6. UNIX for Advanced & Expert Users
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
7. Shell Programming and Scripting
Ques from newbie
I want to total column X from large number of files, and view totals for each file separately with the filename.
I have tried:
for i in `ls -1 *.pattern`; do cat "$i" | awk '{SUM += $4} END { printf("%8d\t%8d\n", $i,SUM) }'; done
does not work. appreciate your help (5 Replies)
Discussion started by: analyst
5 Replies
8. Shell Programming and Scripting
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. UNIX for Dummies Questions & Answers
Hi guys
I am newbie in using linux, how can i Separate file into multiples linux. I want the lines with same parent and id numbers print out into same files.
For example
Gm17 5135289 5136789 . Parent=533;ID=534;Name=Glyma17g07060 -
Gm17 5135289 5136789 . ... (2 Replies)
Discussion started by: grace_shen
2 Replies
10. Shell Programming and Scripting
Hi,
I need to number the lines in my text file. I know how to do this with standard numbering (1,2,3,4, etc) but I need to count in multiples of 5, beginning 0,5,10,15...
example existing file:
abcd
efg
hijklm
nopqrs
desired output
0 abcd
5 efg
10 hijklm
15 ... (11 Replies)
Discussion started by: livbaddeley
11 Replies
LEARN ABOUT SUNOS
libart_lgpl_2
libart_lgpl_2.3(3) Introduction to Library Functions libart_lgpl_2.3(3)
NAME
libart_lgpl_2 - Libart 2D drawing library
DESCRIPTION
Libart is a vector-based 2D drawing library with antialiasing and alpha composition. A superset of the PostScript imaging model is imple-
mented by the library. The library is written in optimized C code, has a very small memory footprint and has no dependencies on any other
GNOME libraries. No API documentation is currently supplied with the library.
FILES
The following files are used by this application:
/usr/lib/libart_lgpl_2.sLibart 2D drawing shared library
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-libs |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
libgnomecanvas(3)
NOTES
Written by Mark McLoughlin, Sun Microsystems Inc., 2003.
SunOS 5.10 10 Jan 2003 libart_lgpl_2.3(3)