07-15-2009
Sort
You may want to check the disk space where your /tmp is ?
Thanks
Ashok
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a file containing many records separated by a % that I would like to sort uniquely (and if possible with a count of dupes) while maintaining the integrity of each record.
File looks like this:
%
srcip: 5.6.7.8
srcburb: internal
dstip: 1.2.3.4
dstport: 2000
dstburb: external... (12 Replies)
Discussion started by: earnstaf
12 Replies
2. Solaris
Can any one give me command How to delete duplicate records with out sort.
Suppose if the records like below:
345,bcd,789
123,abc,456
234,abc,456
712,bcd,789
out tput should be
345,bcd,789
123,abc,456
Key for the records is 2nd and 3rd fields.fields are seperated by colon(,). (2 Replies)
Discussion started by: svenkatareddy
2 Replies
3. Shell Programming and Scripting
Can any one give me command How to delete duplicate records with out sort.
Suppose if the records like below:
345,bcd,789
123,abc,456
234,abc,456
712,bcd,789
out tput should be
345,bcd,789
123,abc,456
Key for the records is 2nd and 3rd fields.fields are seperated by colon(,). (19 Replies)
Discussion started by: svenkatareddy
19 Replies
4. Shell Programming and Scripting
Hi,
I am new to scripting. I need a script to sort and the records in a file and then split them into different files.
For example, the file is:
H1......................
H2......................
D2....................
D2....................
H1........................... (15 Replies)
Discussion started by: Sunitha_edi82
15 Replies
5. Shell Programming and Scripting
Hello,
I have got one file with more than 120+ million records(35 GB in size). I have to extract some relevant data from file based on some parameter and generate other output file.
What will be the besat and fastest way to extract the ne file.
sample file format :--... (2 Replies)
Discussion started by: learner16s
2 Replies
6. Shell Programming and Scripting
I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
Discussion started by: CheeseHead1
1 Replies
7. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I So, I've got a monster text document comprising a list of various company names and associated info just in a long list one after another. I need to sort them alphabetically by name...
The text document looks like this:
Company Name:
the_first_company's_name_here
Address:... (2 Replies)
Discussion started by: quee1763
2 Replies
9. Shell Programming and Scripting
Dear All,
I have two files both containing 10 Million records each separated by comma(csv fmt).
One file is input.txt other is status.txt.
Input.txt-> contains fields with one unique id field (primary key we can say)
Status.txt -> contains two fields only:1. unique id and 2. status
... (8 Replies)
Discussion started by: vguleria
8 Replies
10. Shell Programming and Scripting
I have a file which has number of pipe delimited records.
I am able to read the records....but I want to sort it after reading.
i=0
while IFS="|" read -r usrId dataOwn expire email group secProf startDt endDt smhRole RoleCat DataProf SysRole MesgRole SearchProf
do
print $usrId $dataOwn... (4 Replies)
Discussion started by: harish468
4 Replies
LEARN ABOUT DEBIAN
xmlsort
XMLSORT(1p) User Contributed Perl Documentation XMLSORT(1p)
NAME
xmlsort - sorts 'records' in XML files
SYNOPSIS
xmlsort -r=<recordname> [ <other options> ] [ <filename> ]
Options:
-r <name> name of the elements to be sorted
-k <keys> child nodes to be used as sort keys
-i ignore case when sorting
-s normalise whitespace when comparing sort keys
-t <dir> buffer records to named directory rather than in memory
-m <bytes> set memory chunk size for disk buffering
-h help - display the full documentation
Example:
xmlsort -r 'person' -k 'lastname;firstname' -i -s in.xml >out.xml
DESCRIPTION
This script takes an XML document either on STDIN or from a named file and writes a sorted version of the file to STDOUT. The "-r" option
should be used to identify 'records' in the document - the bits you want sorted. Elements before and after the records will be unaffected
by the sort.
OPTIONS
Here is a brief summary of the command line options (and the XML::Filter::Sort options which they correspond to). For more details see
XML::Filter::Sort.
-r <recordname> (Record)
The name of the elements to be sorted. This can be a simple element name like 'person' or a pathname like 'employees/person' (only
person elements contained directly within an employees element).
-k <keys> (Keys)
Semicolon separated list of elements (or attributes) within a record which should be used as sort keys. Each key can optionally be
followed by 'alpha' or 'num' to indicate alphanumeric of numeric sorting and 'asc' or 'desc' for ascending or descending order (eg: -k
'lastname;firstname;age,n,d').
-i (IgnoreCase)
This option makes sort comparisons case insensitive.
-s (NormaliseKeySpace)
By default all whitespace in the sort key elements is considered significant. Specifying -s will case leading and trailing whitespace
to be stripped and internal whitespace runs to be collapsed to a single space.
-t <directory> (TempDir)
When sorting large documents, it may be prudent to use disk buffering rather than memory buffering. This option allows you to specify
where temporary files should be written.
-m <bytes> (MaxMem)
If you use the -t option to enable disk buffering, records will be collected in memory in 'chunks' of up to about 10 megabytes before
being sorted and spooled to temporary files. This option allows you to specify a larger chunk size. A suffix of K or M indicates
kilobytes or megabytes respectively.
SEE ALSO
This script uses the following modules:
XML::SAX::ParserFactory
XML::Filter::Sort
XML::SAX::Writer
AUTHOR
Grant McLean <grantm@cpan.org>
COPYRIGHT
Copyright (c) 2002 Grant McLean. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.12.4 2002-06-14 XMLSORT(1p)