04-13-2011
Getting Next Best Hit..
Hi.. I need to get the following output from the input file like this
INPUT
|
GRM1 GRM1 0 |
GRM1 ABC1 1 |
GRM1 FEQ1 2 |
GRM1 SED1 3 |
ABC2 GRM1 0 |
ABC2 ABC2 1 |
ABC2 FEQ1 2 |
ABC2 BED1 3 |
SED1 SED1 0 |
SED1 SED1 1 |
SED1 SED1 2 |
SED1 ABC1 3 |
OUTPUT:
|
GRM1 ABC1 1 |
ABC2 GRM1 0 |
SED1 ABC1 3 |
I need the best result row other than matching to itself.. like (GRM1 GRM1 0) as it is matching to itself i dont need it, i need next one only and ignore other rows in that set.. same as in second set, first row is not with itself so i can take it.. where as in third set, first three rows are matching to itself so i need fourth row..
I wrote a script in perl, its ignoring if it matches to itself but giving all other rows..
---------- Post updated at 11:04 PM ---------- Previous update was at 05:59 PM ----------
Any help please
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I reinstalled my Linux box with RedHat 7.2 and used the ext3 journaling file system. This thing is a pig now. There isn't much running on the box, and performance is sad. (1 Reply)
Discussion started by: 98_1LE
1 Replies
2. UNIX for Dummies Questions & Answers
Dear friends,
Does any one know about alert "write catch hit ratio" on Solaris 9?
How to avoid???? (0 Replies)
Discussion started by: solaris5.10
0 Replies
3. Filesystems, Disks and Memory
Is it slower to open or create a file in a directory with 1 million files than a directory with 1000 files? How much slower? Where can I find information about this?
I'm mainly concerned about JFS on AIX, but also NTFS on Windows Server. Is there a difference?
I'm trying to determine a good... (6 Replies)
Discussion started by: cyner
6 Replies
4. Shell Programming and Scripting
Hi all, I have a php file that grabs xml, parses it and updates my db accordingly. I want to automate the execution of this process, rather than having to hit the url manually.
I have been looking into using cron to execute a script to do this, however i'm not exactly sure what command i would... (1 Reply)
Discussion started by: restivz77
1 Replies
5. Programming
hi,
in my application, i have set up to capture SIGINT and execute a handler.the problem is whenever i hit C-c, multiple SIGINT are sent to the application.I have blocked the SIGINT right after catching the first one but it is unsuccessful.Here is what i do :
jmp_buf main_loop;
int... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies
6. Shell Programming and Scripting
I have a unix shell script (ex.sh) written.
How to find out how many users (incl. myself) have run this .sh ?
I can insert code snipet at top of script if need be.
- Ravi (2 Replies)
Discussion started by: ravi368
2 Replies
7. SuSE
Hello,
I'm having trouble looking for info for SUSIE on this CVE-2012-4681.
This is basically the newest Java hit. It is mostly a web browser issue but I would like to see if the versions on our servers are vulnerable. I already found the pages/info for Solaris and RHEL.
Any help would be... (4 Replies)
Discussion started by: bitlord
4 Replies
8. Cybersecurity
Hello,
I'm having an issue with VNC. Security at work says that they scanned my servers (Solaris, RHEL, SLES) and found that you don't need a password to access a VNC session. I have tested this and you can't login to the VNC session without a password. Can someone tell what the Retina scanner... (1 Reply)
Discussion started by: bitlord
1 Replies
9. Shell Programming and Scripting
Hello,
I know that gnu grep has option of -A and -B to extra previous and next lines.
But I'm using HP UX and its grep does not support these options.
BID="0/0/6/1/1.145.17.255.0.0.0"
I need to search a file using $BID and get next 5 lines and previous 5 lines separately.
Please... (1 Reply)
Discussion started by: reddyr
1 Replies
10. Shell Programming and Scripting
Hello,
I am looking to hit a URL using curl and click on submit button so that I can get the results. The below is the code
<input name="tos_accepted" id="tos_accepted" class="button" type="submit" value="Yes, I Agree"/>
<input name="tos_discarded" id="tos_discarded"... (1 Reply)
Discussion started by: Kochappa
1 Replies
LEARN ABOUT REDHAT
create_table_as
CREATE TABLE
AS(7) SQL Commands CREATE TABLE AS(7)
NAME
CREATE TABLE AS - create a new table from the results of a query
SYNOPSIS
CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name [ (column_name [, ...] ) ]
AS query
DESCRIPTION
CREATE TABLE AS creates a table and fills it with data computed by a SELECT command. The table columns have the names and data types asso-
ciated with the output columns of the SELECT (except that you can override the column names by giving an explicit list of new column
names).
CREATE TABLE AS bears some resemblance to creating a view, but it is really quite different: it creates a new table and evaluates the query
just once to fill the new table initially. The new table will not track subsequent changes to the source tables of the query. In contrast,
a view re-evaluates its defining SELECT statement whenever it is queried.
PARAMETERS
[LOCAL] TEMPORARY or [LOCAL] TEMP
If specified, the table is created as a temporary table. Refer to CREATE TABLE [create_table(7)] for details.
table_name
The name (optionally schema-qualified) of the table to be created.
column_name
The name of a column in the new table. Multiple column names can be specified using a comma-delimited list of column names. If col-
umn names are not provided, they are taken from the output column names of the query.
query A query statement (that is, a SELECT command). Refer to SELECT [select(7)] for a description of the allowed syntax.
DIAGNOSTICS
Refer to CREATE TABLE [create_table(7)] and SELECT [select(7)] for a summary of possible output messages.
NOTES
This command is functionally equivalent to SELECT INTO [select_into(7)], but it is preferred since it is less likely to be confused with
other uses of the SELECT ... INTO syntax.
COMPATIBILITY
This command is modeled after an Oracle feature. There is no command with equivalent functionality in SQL92 or SQL99. However, a combina-
tion of CREATE TABLE and INSERT ... SELECT can accomplish the same thing with little more effort.
HISTORY
The CREATE TABLE AS command has been available since PostgreSQL 6.3.
SEE ALSO
CREATE TABLE [create_table(7)], CREATE VIEW [create_view(l)], SELECT [select(l)], SELECT INTO [select_into(l)]
SQL - Language Statements 2002-11-22 CREATE TABLE AS(7)