Hi,
I have a log file which might have certain paragraphs.
Switch not possible Error code 1234
Process number 678
Log not available Error code 567
Process number 874
.....
......
......
Now I create an exception file like this.
cat text.exp
Error code 1234
Process number 874 (7 Replies)
In a directory, there are two different file extensions (*.txt and *.xyz) having similar names of numerical strings (*). The (*.txt) contains 5000 multiple files and the (*.xyz) also contains 5000 multiple files. Each of the files has around 4000 rows and 8 columns, with several unique string... (5 Replies)
I have a file name in $f. If $f has "-" at the beginning, or "=", or does not have extension ".ry" or ".xt" or ".dat" then cerr would not be empty.
Tried the following but having some problems.
set cerr = `echo $f | awk '/^-|=|!.ry|!.xt|!.dat/'` (4 Replies)
Hi Guys,
I have file like below, I want to print all lines between test1231233 to its 10 occurrence(till line 41)
test1231233
qwe
qwe
qweq123
test1231233
qwe
qwe
qweq23
test1231233
qwe
qwe
qweq123
test1231233
qwe
qwe
qweq123131 (3 Replies)
Hi,
I need to find records with a search string from a file. Search strings are provided in a file.
For eg. search_String.txt file is like below
chicago
mexico
newark
sanhose
and the file from where the records need to be fetched is given below
src_file:... (1 Reply)
Hi,
I wasn't quite sure how to title this one! Here goes:
I have some already partially parsed log files, which I now need to extract info from. Because of the way they are originally and the fact they have been partially processed already, I can't make any assumptions on the number of... (8 Replies)
Hi,
I have requirement to find the matching patterns of two files in Unix. One file is the log file and the other is the error list file. If any pattern in the log file matches the list of errors in the error list file, then I would need to find the counts of the match.
For example,
... (5 Replies)
Delete patterns matching
OS version: RHEL 7.3
Shell : Bash
I have a file like below (pattern.txt). I need to delete all lines starting with the following words (words separated by comma below) and ) character.
LOGGING, NOCOMPRESS, TABLESPACE , PCTFREE, INITRANS, MAXTRANS, STORAGE,... (3 Replies)
i have a file where the hostnames and variables are in same line in below format, am able extract some part variables while otherlike subscriptions and handler is missing.
can you please correct me if grep is able to perform this ?
cat /tmp/test
localhost subscriptions='' handler="genie"... (14 Replies)
Discussion started by: rakeshkumar
14 Replies
LEARN ABOUT DEBIAN
dispatch_apply_f
dispatch_apply(3) BSD Library Functions Manual dispatch_apply(3)NAME
dispatch_apply -- schedule blocks for iterative execution
SYNOPSIS
#include <dispatch/dispatch.h>
void
dispatch_apply(size_t iterations, dispatch_queue_t queue, void (^block)(size_t));
void
dispatch_apply_f(size_t iterations, dispatch_queue_t queue, void *context, void (*function)(void *, size_t));
DESCRIPTION
The dispatch_apply() function provides data-level concurrency through a "for (;;)" loop like primitive:
dispatch_queue_t the_queue = dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT);
size_t iterations = 10;
// 'idx' is zero indexed, just like:
// for (idx = 0; idx < iterations; idx++)
dispatch_apply(iterations, the_queue, ^(size_t idx) {
printf("%zu
", idx);
});
Like a "for (;;)" loop, the dispatch_apply() function is synchronous. If asynchronous behavior is desired, please wrap the call to
dispatch_apply() with a call to dispatch_async() against another queue.
Sometimes, when the block passed to dispatch_apply() is simple, the use of striding can tune performance. Calculating the optimal stride is
best left to experimentation. Start with a stride of one and work upwards until the desired performance is achieved (perhaps using a power
of two search):
#define STRIDE 3
dispatch_apply(count / STRIDE, queue, ^(size_t idx) {
size_t j = idx * STRIDE;
size_t j_stop = j + STRIDE;
do {
printf("%zu
", j++);
} while (j < j_stop);
});
size_t i;
for (i = count - (count % STRIDE); i < count; i++) {
printf("%zu
", i);
}
FUNDAMENTALS
Conceptually, dispatch_apply() is a convenient wrapper around dispatch_async() and a semaphore to wait for completion. In practice, the dis-
patch library optimizes this function.
The dispatch_apply() function is a wrapper around dispatch_apply_f().
SEE ALSO dispatch(3), dispatch_async(3), dispatch_queue_create(3), dispatch_semaphore_create(3)Darwin May 1, 2009 Darwin