counting lines containing two column field values with awk
Hello everybody,
I'm trying to count the number of consecutive lines in a text file which have two distinctive column field values. These lines may appear in several line blocks within the file, but I only want a single block to be counted.
This was my first approach to tackle the problem (I'm a beginner, so be gentle ) ...
# find line in which pattern INT appears for the first time in file topology
# print molecule number of field 5 in that line into MOL
# count number of lines that INT and MOL appear IN THE FILE
The main problem is that this (bad) code does not restrict the number NINT to a single block of occurring lines, which I need.
I've tried working with some loops but I messed it up every time. Can you help me out?
Hi all, I need some help on switching field/column values. For example I have a file name data.txt which contains:
a b
a b
a b
and I want to switch a and b and save it to the same file.
the file data.txt then will have:
b a
b a
b a
The problem is, well, I know how to... (7 Replies)
Hi,
Im trying to create a script that reads throught every line in a file and then counts how many lines there with a certain field that matches a input, and also ausing another awk it has to do the same as the above but to then use sort anduniq to get rid of all the unique lines with another... (8 Replies)
Hi All,
I'm looking for a script which can transpose field names from column headers to values in one column.
for example, the input is:
IDa;IDb;IDc;PARAM1;PARAM2;PARAM3;
a;b;c;p1val;p2val;p3val;
d;e;f;p4val;p5val;p6val;
g;h;i;p7val;p8val;p9val;
into the output like this:
... (6 Replies)
I would like to compare the values of 2nd column of consecutive lines of same file in such a way so that if the difference between first value and second value is more than 100 it should print complete line else ignore line.
Input File
==========
PDB 2500
RTDB 123
RTDB-EAGLE 122
VSCCP 2565... (4 Replies)
Hello,
I am new to Linux environment , I working on Linux script which should send auto email based on the specific condition from log file. Below is the sample log file
Name m/c usage
abc xxx 10
abc xxx 20
abc xxx 5
xyz ... (6 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hey everyone,
I have a bunch of lines with values in field 4 that I am interested in.
If these values are between 1 and 3 I want it to count all these values to all be counted together and then have the computer print out
LOW and the number of lines with those values in between 1 and 3,... (2 Replies)
Hi all,
I am new to using awk and am quickly discovering what a powerful pattern-recognition tool it is. However, I have what seems like a fairly basic task that I just can't figure out how to perform in one line. I want awk to find and print all the lines in which one of multiple patterns (e.g.... (8 Replies)
Hi,
I have multiple files that each contain four columns of strings:
File1:
Code:
123 abc gfh 273
456 ddff jfh 837
789 ghi u4u 395
File2:
Code:
123 abc dd fu
456 def 457 nd
891 384 djh 783
I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
this is part of a KT i am going thru.
i am writing a script in bash shell, linux where i have 2 columns where 1st signifies the nth hour like 00, 01, 02...23 and 2nd the file size.
sample data attached.
Desired output is 3 columns which will give the nth hour, number of entries in nth hour and... (3 Replies)
Discussion started by: alpha_1
3 Replies
LEARN ABOUT DEBIAN
hwloc_topology_check
Create and Destroy Topologies(3) Hardware Locality (hwloc) Create and Destroy Topologies(3)NAME
Create and Destroy Topologies -
Functions
int hwloc_topology_init (hwloc_topology_t *topologyp)
int hwloc_topology_load (hwloc_topology_t topology)
void hwloc_topology_destroy (hwloc_topology_t topology)
void hwloc_topology_check (hwloc_topology_t topology)
Function Documentation
void hwloc_topology_check (hwloc_topology_ttopology)
Run internal checks on a topology structure. The program aborts if an inconsistency is detected in the given topology.
Parameters:
topology is the topology to be checked
Note:
This routine is only useful to developers.
The input topology should have been previously loaded with hwloc_topology_load().
void hwloc_topology_destroy (hwloc_topology_ttopology)
Terminate and free a topology context. Parameters:
topology is the topology to be freed
int hwloc_topology_init (hwloc_topology_t *topologyp)
Allocate a topology context. Parameters:
topologyp is assigned a pointer to the new allocated context.
Returns:
0 on success, -1 on error.
int hwloc_topology_load (hwloc_topology_ttopology)
Build the actual topology. Build the actual topology once initialized with hwloc_topology_init() and tuned with Configure Topology
Detection routines. No other routine may be called earlier using this topology context.
Parameters:
topology is the topology to be loaded with objects.
Returns:
0 on success, -1 on error.
See also:
Configure Topology Detection
Author
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
Version 1.4.1 Mon Feb 27 2012 Create and Destroy Topologies(3)