UNIX command to select the best edge values from a network file
I have a tab-delimited data representing network data (undirected). Among the duplicated edges, I wanted to select those edges for which I have the higher absolute value of the log values.
I have written a code in python, but its taking a lot of time. I would be grateful if someone helps me with an awk command. Kindly note, the network is undirected, i.e. A--B and B--A are duplicate edges. My original file has a large number of columns, I have given a simplified test data
Test data
Expected Output
Last edited by Scrutinizer; 03-11-2020 at 12:29 AM..
Problem Overview: We have a scheduler that prints report on any of the network printer.
Problem Statement: We need to find a UNIX command that picks up either A4, legal or letter size paper form the printer.
I found out a command but it's not working on our environment.
... (3 Replies)
Hi ,
I have a similar problem.
Please can anyone help me with a shell script or a perl.
I have a flat file like this
fruit country
apple germany
apple india
banana pakistan
banana saudi
mango india
I want to get a output like
fruit country
apple ... (7 Replies)
I have high values (such as ÿÿÿÿ) in a text file contained in an Unix AIX server. I need to identify all the records
which are having these high values and also get the position/column number in the record structure if possible. Is there
any Unix command by which this can be done to :
1.... (5 Replies)
Hi,
(Oracle, AIX)
I have googled this and searched this forum, however I haven't had much luck with an answer and have tried several different things.
Basically I have a SQL select statement which generates a whole load of UPDATE statements, I want to run the select statement via... (13 Replies)
I have a huge file and I want to select first 10 charcters and last 2 characters of everyline and than will filter the unique line.
I know, it must be easy bt I am new to unix scripting:)
Ex.
I have file as below and need to e3kbaird and last 2 characters. and than unique records.
... (3 Replies)
I want to compare 4 edge-lists to basically see if an edge is present in all 4 networks. The issue is that an edge A-B in one file can be present as B-A in another file.
Example:
Input 1: net1.txt
A B 0.1
C D 0.65
D E 0.9
E A 0.7
Input 2: net2.txt
A Z 0.1
C D 0.65
E D 0.9
E A... (1 Reply)
Hi All,
I am trying to select the rows in a fixed width file based on values in the columns.
I want to select only the rows if column position 3-4 has the value AB
I am using cut command to get the column values. Is it possible to check if cut -c3-4 = AB is true then select only that... (2 Replies)
Hi All,
we have a requirement to split a content in a text file every 5 rows and write in a new file .
conditions:
if 5th line falls between center of the statement . it should look upto after ";"
files are below format:
1 UPDATE TABLE TEST1 SET VALUE ='AFDASDFAS'
2 WHERE... (3 Replies)
Discussion started by: KK230689
3 Replies
LEARN ABOUT DEBIAN
lfc_perl
lfc_perl(3) Perl Programmers Reference Guide lfc_perl(3)NAME
lfc - Perl interface to the LFC
SYNOPSIS
use lfc;
printf "CNS_LIST_BEGIN is %d
", $lfc::CNS_LIST_BEGIN;
DESCRIPTION
The lfc module permits you to access the LFC client interface from perl programs. The lfc module is a swig wrapping of the standard C
interface. For detailed descriptions of each function see the individual man page of each function.
There follows a series of examples of how to use selected functions and how to retrieve the information returned by them: Examples are
finding the GUID of an existing entry, listing the replicas of a given GUID and setting and retrieving the comment associated with an
entry.
EXAMPLE
#!/usr/bin/perl -w
use strict;
use lfc;
# stat an existing entry in the LFC and print the GUID
my ($name,$stat,$guid,$res);
$name = "/grid/dteam/my.test";
$stat = lfcc::new_lfc_filestatg();
$res = lfc::lfc_statg($name,undef,$stat);
if ($res == 0) {
$guid = lfcc::lfc_filestatg_guid_get($stat);
print "The GUID for $name is $guid
";
} else {
my $err_num = $lfc::serrno;
my $err_string = lfc::sstrerror($err_num);
print "There was an error while looking for $name: Error $err_num ($err_string)
";
exit(1);
}
lfcc::delete_lfc_filestatg($stat);
EXAMPLE
#!/usr/bin/perl -w
use strict;
use lfc;
# list the replicas of a given entry, starting from the GUID
my ($guid,$listp,$flag,$num_replicas);
$guid = "6a3164e0-a4d7-4abe-9f76-e3b8882735d1";
$listp = lfcc::new_lfc_list();
$flag = $lfc::CNS_LIST_BEGIN;
print "Listing replicas for GUID $guid:
";
$num_replicas=0;
while(1) {
my $res = lfc::lfc_listreplica(undef,$guid,$flag,$listp);
$flag = $lfc::CNS_LIST_CONTINUE;
if (!defined $res) {
last;
} else {
my $rep_name = lfcc::lfc_filereplica_sfn_get($res);
print "Replica: $rep_name
";
$num_replicas++;
}
}
lfc::lfc_listreplica(undef,$guid,$lfc::CNS_LIST_END,$listp);
lfcc::delete_lfc_list($listp);
print "Found $num_replicas replica(s)
";
EXAMPLE
#!/usr/bin/perl -w
use strict;
use lfc;
# setting and retrieving a comment on a file
my ($file,$res,$bufspec,$buffer,$comment);
$file = "/grid/dteam/my.test";
$comment = "MyComment";
$res = lfc::lfc_setcomment($file,$comment);
if ($res != 0) {
my $err_num = $lfc::serrno;
my $err_string = lfc::sstrerror($err_num);
print "Problem while setting comment for $file: Error $err_num ($err_string)
";
exit(1);
}
$bufspec = "x".($lfc::CA_MAXCOMMENTLEN+1);
$buffer = pack($bufspec);
$res = lfc::lfc_getcomment($file,$buffer);
if ($res != 0) {
my $err_num = $lfc::serrno;
my $err_string = lfc::sstrerror($err_num);
print "Problem while reading the comment for $file: Error $err_num ($err_string)
";
exit(1);
}
$comment = unpack("Z*", $buffer);
print "Read back comment $comment
";
NOTES
The current interface to the lfc_getcomment(3), lfc_getcwd(3), lfc_readlink(3), lfc_seterrbuf(3) requires the passing of a suitably allo-
cated buffer (in a similar way to the C functions). However this is rather non standard in PERL. A future version of lfc perl interface may
do away with the need to setup the buffer before the call and to explicitly unpack the result afterwards.
SEE ALSO
LFC C interface man pages
LFC $Date: 2007/02/23 10:03:07 $ lfc_perl(3)