Hi All,
I have 1 million records file. Using awk, I am counting the number of records. But as the number is huge, after crossing a number, awk is displaying it in exponential format.
At the end, I need to verify this count given by awk with expected count.
But as it is in exponential format,... (3 Replies)
i have a line like this in my script
IP=`get_IP <hostname> | awk '{ print $1 }'
echo $IP
the problem is get_IP <hostname> returns data formated as follows:
ip 1.1.1.1 name server_name
the code above returns
1.1.1.1 server_name and i just need the 1.1.1.1
I have tried to add "|... (5 Replies)
Hello, I have the following file, but one of his columns is not in place, and tried with SED and AWK, how I can correct format?
In the second line break is wrong, and puts it after the first column of next line
I would appreciate if you could guide me on the subject. (4 Replies)
Hello,
I am trying to count how many times a subject makes a correct switch or a correct stay response in a simple task. I have data on which condition they were in (here, labeled "IMAGINE" and "RECALL"), as well as whether they made a left or right button response, and whether the outcome was... (5 Replies)
Hi all,
I think so I’m getting the result is wrong, while using following awk commend,
colval=$(awk 'FNR>1 && NR==FNR{a=$4;next;} FNR>1 {a+=$4; print $2"\t"a/3}'
filename_f.tsv filename_f2.tsv filename_f3.tsv)
echo $colval >> Result.tsv
it’s doing the condition 2 times, first result... (5 Replies)
Hi everyone,
The following piece of awk code works fine if I use eval builtin
var='$1,$2'
ps | eval "awk '{print $var}'"
But when I try to knock off eval and use awk variable as substitute then I am not getting the expected result
ps | awk -v v1=$var '{print v1}' # output is $1,$2
ps |... (4 Replies)
Hi,
I have below data in my flat file.I would like to remove the quotes and comma necessary from the data.Below is the details I would like to have in my output.
Could anybody help me providing the Unix shell script for this.
Input :
ABC,ABC,10/15/2012,"47,936,164.567 ","1,036,997.453... (2 Replies)
I was wondering what is the correct way to read in data "one-part-per-line" as compared with "one-record-per-line" formats into the same structure in C?
format1.dat:
Zacker 244.00 244.00 542.00
Lee 265.00 265.00 456.00
Walter 235.00 235.00 212.00
Zena 323.00 215.45 ... (12 Replies)
The awk below runs and produces the following output on the file2. This is just an example of the format as the file is ~14MB. file1.txt is attached. I am trying to count the ids that match between the two files and out the ids that are missing. Thank you :).
file2
970 NM_213590 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
giieventsqueued
giiEventPoll(3) GGI giiEventPoll(3)NAME
giiEventPoll, giiEventSelect, giiEventsQueued, giiEventRead - Wait for and receive events
SYNOPSIS
#include <ggi/gii.h>
gii_event_mask giiEventPoll(gii_input_t inp, gii_event_mask mask,
struct timeval *t);
int giiEventSelect(gii_input_t inp, gii_event_mask *mask, int n,
fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout);
int giiEventsQueued(gii_input_t inp, gii_event_mask mask);
int giiEventRead(gii_input_t inp, gii_event *ev, gii_event_mask mask);
DESCRIPTION
giiEventPoll waits for specific events to become available on an input. This call somewhat resembles the Unix select(2) call, but only for
LibGII events and is more portable. The function returns after an event matching the given event mask is available or after the amount of
time specified by t has elapsed, whichever occurs first. If t is NULL, there is no timeout.
The timeout value on return is updated to the time that would have been remaining. So make sure to re-setup this value when calling
giiEventPoll in a loop.
giiEventSelect is the combination of giiEventPoll and select(2) allowing to wait for both LibGII events and arbitrary file descriptors in
any of the three states. However, this function is not available if the operating system does not support the select(2) call, not even as
a stub.
giiEventsQueued returns the number of events matching the specified event mask that are currently queued in the input.
giiEventRead blocks for and transfers an event from the given input to the location pointed to by ev. The event with the earliest timestamp
that matches the given mask is returned to the application.
RETURN VALUE
giiEventPoll returns a mask of available events (constrained by the given mask). It is 0 if no events are available. On error, an nega-
tive gii-error(3) code is returned.
giiEventSelect returns the same values as select(2). Unlike other LibGGI/LibGII functions, it also uses errno. It will update the timeout
regardless of whether or not the system call does so.
giiEventsQueued returns the number of events.
giiEventRead returns the size of event on success, and 0 on error.
EXAMPLES
This is one of the various ways of coding an event-polling loop:
for(;;) {
tv.tv_sec = 0;
tv.tv_usec = 100; /* change to 0 for non-blocking behaviour */
ggiEventPoll(vis, emAll, &tv);
n = ggiEventsQueued(vis, emAll);
/* Process events in one gulp, when available */
while(n--) {
ggiEventRead(vis, &ggievent, emAll);
switch(ggievent.any.type) {
/* ... */
}
}
/* Do other stuff */
}
Note: This code uses the LibGGI functions and types instead of the LibGII ones, since the former is the more common case.
libgii-1.0.x 2006-12-30 giiEventPoll(3)