03-03-2017
Yes! It works, it is the other real life data I am not showing in my example. Thanks guys.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
M 47 HIS:LOT 32 DUTY 2 MIKE, FINISHED
MIKE ACTIVE STATUS
23TASK YES GOOD
100TASK NO GOOD
========================================
M 47 HIS:LOT 1 DUTY 1 MIKE, FINISHED
MIKE ACTIVE STATUS
23TASK YES GOOD
... (7 Replies)
Discussion started by: bobo
7 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
I have a test file that has the format:
.....
O
3.694950 -.895050 1.480000
O
5.485050 .895050 1.480000
Ti
-4.590000 4.590000 2.960000
Ti
-2.295000 ... (5 Replies)
Discussion started by: aarondesk
5 Replies
3. UNIX for Dummies Questions & Answers
I'm looking for a sort command that will sort by zip code first then by last name. (zip code is the last field, last name is first field)
data file looks like this.
Hope Bob 1234 Main ST. Colorado Springs, CO 80920
I was thinking along the lines of:
sort -k9n address.data //for the... (2 Replies)
Discussion started by: ssgatbliss
2 Replies
4. UNIX for Dummies Questions & Answers
I was trying to check for the sort of some columns (say 1-10) of particular file. Now, by default, the Unix sort uses as a separator whitespace (e.g. if you have 'foo bar' then it separates it into 'foo' and 'bar' to use as keys)
Now, I know which particular columns I want to use as the sort... (1 Reply)
Discussion started by: rev.meister
1 Replies
5. Shell Programming and Scripting
Hi all.
Is there a way that I can use the sort command too sort the following field by earliest time (12:00AM) to latest time (11:59PM)?
07:12PM
07:53PM
07:54PM
08:07PM
10:15AM
10:21AM
TIA!!!!!! (1 Reply)
Discussion started by: lyoncc
1 Replies
6. Shell Programming and Scripting
Hi all.
HPUX - posix shell - script question
Here's my data:
f1 f2 f3 f4 f5 f6
|02/12/09|12:33PM|3|Oceanview |OVT #1| VISA/MC
|02/12/09|12:14PM|3|Oceanview |OVT #1| VISA/MC
|02/12/09|09:13AM|4|Oceanview |OVT #1| VISA/MC ... (8 Replies)
Discussion started by: lyoncc
8 Replies
7. Shell Programming and Scripting
Hello,
I have a large data file:
1234 8888 bbb
2745 8888 bbb
9489 8888 bbb
1234 8888 aaa
4838 8888 aaa
3977 8888 aaa
I need to remove duplicate lines (where the first column is the duplicate). I have been using:
sort file.txt | uniq -w4 > newfile.txt
However, it seems to keep the... (11 Replies)
Discussion started by: palex
11 Replies
8. Shell Programming and Scripting
Hi Guys,
I have a file to be sorted and uniq with the following format.
S00001002|01|20021231
S00001002|01|20011031
S00001006|01|20120430
S00001006|01|20111231
S00001006|01|20111031
S00001006|01|20110831
S00001006|01|20110731
S00001006|01|20101231
S00001006|01|20091231... (5 Replies)
Discussion started by: nua7
5 Replies
9. UNIX for Dummies Questions & Answers
I have a file like this:
/vol/eng_app_0103z
/vol/eng_app_0103z
/vol/eng_app_0120z
/vol/eng_app_0126z
/vol/eng_app_0144z
/vol/eng_app_0150z
/vol/eng_app_0154z
/vol/eng_app_01551z
/vol/eng_app_01552z
/vol/eng_app_0155z
/vol/eng_app_0164z
/vol/eng_app_0199zWhen I use the sort command... (3 Replies)
Discussion started by: newbie2010
3 Replies
10. Shell Programming and Scripting
I have a question about what the sort command is doing.
Here is some sample data:
348201310013RVE 2
600201310013GFJ 70
3302013020101NS 40
600201309013GFJ 70
The sort command that is running is as follows:
sort -k 1,3 -k 12,4 input.txt > output.txt
... (6 Replies)
Discussion started by: Drenhead
6 Replies
LEARN ABOUT DEBIAN
object::id
Object::ID(3pm) User Contributed Perl Documentation Object::ID(3pm)
NAME
Object::ID - A unique identifier for any object
SYNOPSIS
package My::Object;
# Imports the object_id method
use Object::ID;
DESCRIPTION
This is a unique identifier for any object, regardless of its type, structure or contents. Its features are:
* Works on ANY object of any type
* Does not modify the object in any way
* Does not change with the object's contents
* Is O(1) to calculate (ie. doesn't matter how big the object is)
* The id is unique for the life of the process
* The id is always a true value
USAGE
Object::ID is a role, rather than inheriting its methods they are imported into your class. To make your class use Object::ID, simply "use
Object::ID" in your class.
package My::Class;
use Object::ID;
Then write your class however you want.
METHODS
The following methods are made available to your class.
object_id
my $id = $object->object_id;
Returns an identifier unique to the $object.
The identifier is not related to the content of the object. It is only unique for the life of the process. There is no guarantee as to
the format of the identifier from version to version.
For example:
my $obj = My::Class->new;
my $copy = $obj;
# This is true, $obj and $copy refer to the same object
$obj->object_id eq $copy->object_id;
my $obj2 = My::Class->new;
# This is false, $obj and $obj2 are different objects.
$obj->object_id eq $obj2->object_id;
use Clone;
my $clone = clone($obj);
# This is false, even though they contain the same data.
$obj->object_id eq $clone->object_id;
object_uuid
my $uuid = $object->object_uuid
Like "$object->object_id" but returns a UUID unique to the $object.
Only works if Data::UUID is installed.
See Data::UUID for more details about UUID.
FAQ
Why not just use the object's reference?
References are not unique over the life of a process. Perl will reuse references of destroyed objects, as demonstrated by this code
snippet:
{
package Foo;
sub new {
my $class = shift;
my $string = shift;
return bless {}, $class;
}
}
for(1..3) {
my $obj = Foo->new;
print "Object's reference is $obj
";
}
This will print, for example, "Object's reference is Foo=HASH(0x803704)" three times.
How much memory does it use?
Very little.
Object::ID stores the ID and address of each object you've asked the ID of. Once the object has been destroyed it no longer stores it. In
other words, you only pay for what you use. When you're done with it, you don't pay for it any more.
LICENSE
Copyright 2010, Michael G Schwern <schwern@pobox.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
THANKS
Thank you to Vincent Pit for coming up with the implementation.
perl v5.12.4 2011-09-26 Object::ID(3pm)