01-08-2007
Dear Anbu!
Thanks for the quick reply. The statment I am using is a Select one. can I use the do method on select statement also?
regards
Apoorva Kumar
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a log file from which I want to cut out the ten lines assoictiated to my search requirment (cust_ref #).
The cust_ref number will be on te first line and the update information will be on the following ten lines (which dosen't linking data to grep on).
Using a script I would like to... (4 Replies)
Discussion started by: nhatch
4 Replies
2. Shell Programming and Scripting
Hello,
I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh.
Here is the snippet.
if ;
then
echo "Begin processing VALUEs"
... (1 Reply)
Discussion started by: jerardfjay
1 Replies
3. Shell Programming and Scripting
Hi everybody:
Could anybody tell me how I can print from a file a selected rows with awk. In my case I only want print in another file all the rows from NR=8 to NR=2459 and the increment each 8 times.
I tried to this:
awk '{for (i=8; i=2459; i+=8); NR==i}' file1 > file2
But doesn't... (6 Replies)
Discussion started by: tonet
6 Replies
4. Shell Programming and Scripting
I need help . I am not getting anything back from my setup. I have defined an oracle package which I am calling from within my sql call, but is returning no rows. If I run my sql from sqlplus works find, does not work whe I try to run from UNIX shell script
My korn script test.ksh
#!bin/ksh... (6 Replies)
Discussion started by: TimHortons
6 Replies
5. Shell Programming and Scripting
Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count
The input file:
21 2341 A
21 2341 A
21 2341 A
21 2341 C
21 2341 C
21 2341 C
21 2341 C
21 4567 A
21 4567 A
21 4567 C
... (6 Replies)
Discussion started by: juelillo
6 Replies
6. UNIX for Dummies Questions & Answers
Greetings!
Can we automate the process of removing a newline char from selected rows in a fixed width file using a shell?
Input is like
abcd1234
xyzd1234
abcd
a1b2c3d4
abcd1234
xyzd1234
xx
abcd1234
Expected output -
abcd1234xyzd1234
abcda1b2c3d4abcd1234xyzd1234
xxabcd1234
... (2 Replies)
Discussion started by: mailme0205
2 Replies
7. Shell Programming and Scripting
Greetings!
Can we automate the process of removing a newline char from selected rows in a fixed width file using a shell?
Input is like
abcd1234
xyzd1234
abcd
a1b2c3d4
abcd1234
xyzd1234
xx
abcd1234
Expected output -
abcd1234xyzd1234
abcda1b2c3d4abcd1234xyzd1234
xxabcd1234
... (3 Replies)
Discussion started by: mailme0205
3 Replies
8. Shell Programming and Scripting
Hi,
I have two files Input1.txt and Input2.txt and i need to have a output with selected lines starting with the values present in Input2.txt.
For example:
Input1.txt:... (5 Replies)
Discussion started by: bhas
5 Replies
9. Shell Programming and Scripting
Hello
I want to collapse a file with multiple rows into consolidated lines of entries based on selected columns as the 'key'.
Example:
1 2 3 Abc def ghi
1 2 3 jkl mno p qrts
6 9 0 mno def Abc
7 8 4 Abc mno mno abc
7 8 9 mno mno abc
7 8 9 mno j k
So if columns 1, 2 and 3 are... (6 Replies)
Discussion started by: linuxlearner123
6 Replies
10. UNIX for Beginners Questions & Answers
Dear All,
I have a data file input.res like below. (Only six column shown here for example.)
Sequence of first column starting from 1 to 148.
Input file
1 Q0 9_August_2014_Entertainment2 0 20.14967806339729 BM25b1.0
1 Q0 13_October_2012_Page323 1 20.134224346765738 BM25b1.0
1 Q0... (2 Replies)
Discussion started by: imranrasheedamu
2 Replies
LEARN ABOUT CENTOS
io::select
IO::Select(3pm) Perl Programmers Reference Guide IO::Select(3pm)
NAME
IO::Select - OO interface to the select system call
SYNOPSIS
use IO::Select;
$s = IO::Select->new();
$s->add(*STDIN);
$s->add($some_handle);
@ready = $s->can_read($timeout);
@ready = IO::Select->new(@handles)->can_read(0);
DESCRIPTION
The "IO::Select" package implements an object approach to the system "select" function call. It allows the user to see what IO handles, see
IO::Handle, are ready for reading, writing or have an exception pending.
CONSTRUCTOR
new ( [ HANDLES ] )
The constructor creates a new object and optionally initialises it with a set of handles.
METHODS
add ( HANDLES )
Add the list of handles to the "IO::Select" object. It is these values that will be returned when an event occurs. "IO::Select" keeps
these values in a cache which is indexed by the "fileno" of the handle, so if more than one handle with the same "fileno" is specified
then only the last one is cached.
Each handle can be an "IO::Handle" object, an integer or an array reference where the first element is an "IO::Handle" or an integer.
remove ( HANDLES )
Remove all the given handles from the object. This method also works by the "fileno" of the handles. So the exact handles that were
added need not be passed, just handles that have an equivalent "fileno"
exists ( HANDLE )
Returns a true value (actually the handle itself) if it is present. Returns undef otherwise.
handles
Return an array of all registered handles.
can_read ( [ TIMEOUT ] )
Return an array of handles that are ready for reading. "TIMEOUT" is the maximum amount of time to wait before returning an empty list,
in seconds, possibly fractional. If "TIMEOUT" is not given and any handles are registered then the call will block.
can_write ( [ TIMEOUT ] )
Same as "can_read" except check for handles that can be written to.
has_exception ( [ TIMEOUT ] )
Same as "can_read" except check for handles that have an exception condition, for example pending out-of-band data.
count ()
Returns the number of handles that the object will check for when one of the "can_" methods is called or the object is passed to the
"select" static method.
bits()
Return the bit string suitable as argument to the core select() call.
select ( READ, WRITE, EXCEPTION [, TIMEOUT ] )
"select" is a static method, that is you call it with the package name like "new". "READ", "WRITE" and "EXCEPTION" are either "undef"
or "IO::Select" objects. "TIMEOUT" is optional and has the same effect as for the core select call.
The result will be an array of 3 elements, each a reference to an array which will hold the handles that are ready for reading, writing
and have exceptions respectively. Upon error an empty list is returned.
EXAMPLE
Here is a short example which shows how "IO::Select" could be used to write a server which communicates with several sockets while also
listening for more connections on a listen socket
use IO::Select;
use IO::Socket;
$lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080);
$sel = IO::Select->new( $lsn );
while(@ready = $sel->can_read) {
foreach $fh (@ready) {
if($fh == $lsn) {
# Create a new socket
$new = $lsn->accept;
$sel->add($new);
}
else {
# Process socket
# Maybe we have finished with the socket
$sel->remove($fh);
$fh->close;
}
}
}
AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perlbug@perl.org>.
COPYRIGHT
Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
perl v5.16.3 2013-03-04 IO::Select(3pm)