Hi,
I have the calculations which return me infinity (inf), -inf, other very larger number when I printed them out.
I did try to insert some control condition not to print these out if the above condition is met. The code I implemented is something like:-
for (i=0;i<=1000;i++){
... (3 Replies)
I want to find duplicates in file on 2nd field i wrote this code:
nawk '{a++} END{for i in a {if (a>1) print}}' temp
Could not find whats wrong with this.
Appreciate help (5 Replies)
I'm primarily a "Windows" systems administrator whose been getting his toes in the Linux waters. I am new to programming and advanced scripting so please bear with me and my incomplete example below.
I have exported all entries from our DNS zones. I used sed to remove everything other than the... (3 Replies)
Hi,
I have a file (sorted by sort) with 8 tab delimited columns. The first column contains duplicated fields and I need to merge all these identical lines.
My input file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba
comp100003 fff fff fff fff fff fff fff... (5 Replies)
Hi,
I am using Ubuntu 12.04
I have a file as following:
KHO123
KHO245
KHO456
.
.
.I want to add a second column of characters to my file but I want to write a script to make this automatic, so, depending on the number of the lines in my first column, I get the string I need repeated... (4 Replies)
I have the following code for removing duplicate records based on fields in inputfile file & moves the duplicate records in duplicates file(1st Awk) & in 2nd awk i fetch the non duplicate entries in inputfile to tmp file and use move to update the original file.
Requirement:
Can both the awk... (4 Replies)
Hi All,
I have searched many threads for possible close solution. But I was unable to get simlar scenario.
I would like to print all duplicate based on 3rd column except the first occurance. Also would like to print if it is single entry(non-duplicate).
i/P file
12 NIL ABD LON
11 NIL ABC... (6 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Greetings Experts,
Issue: Within awk script, remove the duplicate occurrences that are space (1 single space character) separated
Description: I am processing 2 files using awk and during processing, I am building an array and there are duplicates on this; how can I delete the duplicates... (3 Replies)
Perl::Critic::Policy::ControlStructures::ProhibitUnreachUserCContributed PerlPerl::Critic::Policy::ControlStructures::ProhibitUnreachableCode(3pm)NAME
Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode - Don't write code after an unconditional "die, exit, or next".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy prohibits code following a statement which unconditionally alters the program flow. This includes calls to "exit", "die",
"return", "next", "last" and "goto". Due to common usage, "croak" and "confess" from Carp are also included.
Code is reachable if any of the following conditions are true:
o Flow-altering statement has a conditional attached to it
o Statement is on the right side of an operator "&&", "||", "//", "and", "or", or "err".
o Code is prefixed with a label (can potentially be reached via "goto")
o Code is a subroutine
EXAMPLES
# not ok
exit;
print "123
";
# ok
exit if !$xyz;
print "123
";
# not ok
for ( 1 .. 10 ) {
next;
print 1;
}
# ok
for ( 1 .. 10 ) {
next if $_ == 5;
print 1;
}
# not ok
sub foo {
my $bar = shift;
return;
print 1;
}
# ok
sub foo {
my $bar = shift;
return if $bar->baz();
print 1;
}
# not ok
die;
print "123
";
# ok
die;
LABEL: print "123
";
# not ok
croak;
do_something();
# ok
croak;
sub do_something {}
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls
AUTHOR
Peter Guzis <pguzis@cpan.org>
COPYRIGHT
Copyright (c) 2006-2011 Peter Guzis. 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.14.22012-06-0Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode(3pm)