07-10-2008
Which part of the code is not obvious?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a pipe delimited file. Key is field 2, date is field 5 (as example, my real file is more complicated of course, but the KEY and DATE are accurate)
There can be duplicate rows for a key with different dates.
I need to keep only rows with latest date in this case.
Example data: ... (4 Replies)
Discussion started by: LisaS
4 Replies
2. Shell Programming and Scripting
I'm trying to remove lines of data that contain duplicate data in a specific column.
For example.
apple 12345
apple 54321
apple 14234
orange 55656
orange 88989
orange 99898
I only want to see
apple 12345
orange 55656
How would i go about doing this? (5 Replies)
Discussion started by: spartan22
5 Replies
3. Shell Programming and Scripting
Hi,
How to identify duplicate columns in a row?
Input data: may have 30 columns
9211480750 LK 120070417 920091030
9211480893 AZ 120070607
9205323621 O7 120090914 120090914 1420090914 2020090914 2020090914
9211479568 AZ 120070327 320090730
9211479571 MM 120070326
9211480892 MM 120070324... (3 Replies)
Discussion started by: suresh3566
3 Replies
4. Shell Programming and Scripting
Hello,
I'm have a file of xy data with over 1000 records. I want to delete both x and y values for any record that has the same x value as any previous record thus removing the duplicates from my file.
Can anyone help?
Thanks,
Dan (3 Replies)
Discussion started by: DFr0st
3 Replies
5. Shell Programming and Scripting
Hi all
I have a big file like this in rows and columns from 2 column onwards the next column is desciption of previous column means 3rd columns is description of 2 columns and 5 column is description of 4 column.
All cloumns are separated by comma
... (1 Reply)
Discussion started by: manigrover
1 Replies
6. Shell Programming and Scripting
Hello,
I have a large database in which name homonyms are arranged in a row. Since the database is large and generated by hand, very often dupes creep in. I want to remove the dupes either using an awk or perl script.
An input is given below
The expected output is given below:
As can be... (2 Replies)
Discussion started by: gimley
2 Replies
7. Shell Programming and Scripting
Hi, I want to move a new row to another table if the field from new row doesn't have the first word that I categorized (like: IRC blablabla, PTM blablabla, ADM blablabla, BS blablabla).
I already use this script but doesn't work as I expected.
CHECK_KEYWORD="$( mysql -uroot -p123456 smsd -N... (7 Replies)
Discussion started by: jazzyzha
7 Replies
8. Shell Programming and Scripting
Hi, I already succeed moving a new row to another table if the field from new row doesn't have the first word that I categorized (like: IRC blablabla, PTM blablabla, ADM blablabla, BS blablabla).
But it can't delete the old row. Please help me with the script.
my php script:
INSERT INTO... (2 Replies)
Discussion started by: jazzyzha
2 Replies
9. Shell Programming and Scripting
Hi all,
how can delete duplicate files in file form, e.g.
$cat file1
aaa 123 234 345 456
bbb 345 345 657 568
ccc 345 768 897 456
aaa 123 234 345 456
ddd 786 784 234 263
ccc 345 768 897 456
aaa 123 234 345 456
ccc 345 768 897 456
then i need ouput file1 some, (4 Replies)
Discussion started by: aav1307
4 Replies
10. Shell Programming and Scripting
Hi,
I have an input file as shown below:
20140102;13:30;FR-AUD-LIBOR-1W;2.495
20140103;13:30;FR-AUD-LIBOR-1W;2.475
20140106;13:30;FR-AUD-LIBOR-1W;2.495
20140107;13:30;FR-AUD-LIBOR-1W;2.475
20140108;13:30;FR-AUD-LIBOR-1W;2.475
20140109;13:30;FR-AUD-LIBOR-1W;2.475... (2 Replies)
Discussion started by: shash
2 Replies
LEARN ABOUT CENTOS
perl::critic::policy::errorhandling::requirecarping
Perl::Critic::Policy::ErrorHandling::RequireCarping(3) User Contributed Perl Documentation Perl::Critic::Policy::ErrorHandling::RequireCarping(3)
NAME
Perl::Critic::Policy::ErrorHandling::RequireCarping - Use functions from Carp instead of "warn" or "die".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
The "die" and "warn" functions both report the file and line number where the exception occurred. But if someone else is using your
subroutine, they usually don't care where your code blew up. Instead, they want to know where their code invoked the subroutine. The Carp
module provides alternative methods that report the exception from the caller's file and line number.
By default, this policy will not complain about "die" or "warn", if it can determine that the message will always result in a terminal
newline. Since perl suppresses file names and line numbers in this situation, it is assumed that no stack traces are desired either and
none of the Carp functions are necessary.
die "oops" if $explosion; #not ok
warn "Where? Where?!" if $tiger; #not ok
open my $mouth, '<', 'food'
or die 'of starvation'; #not ok
if (! $dentist_appointment) {
warn "You have bad breath!
"; #ok
}
die "$clock not set.
" if $no_time; #ok
my $message = "$clock not set.
";
die $message if $no_time; #not ok, not obvious
CONFIGURATION
By default, this policy allows uses of "die" and "warn" ending in an explicit newline. If you give this policy an
"allow_messages_ending_with_newlines" option in your .perlcriticrc with a false value, then this policy will prohibit such uses.
[ErrorHandling::RequireCarping]
allow_messages_ending_with_newlines = 0
If you give this policy an "allow_in_main_unless_in_subroutine" option in your .perlcriticrc with a true value, then this policy will allow
"die" and "warn" in name space main:: unless they appear in a subroutine, even if they do not end in an explicit newline.
[ErrorHandling::RequireCarping]
allow_in_main_unless_in_subroutine = 1
BUGS
Should allow "die" when it is obvious that the "message" is a reference.
SEE ALSO
Carp::Always
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3 2014-06-09 Perl::Critic::Policy::ErrorHandling::RequireCarping(3)