I have different strings (SQL queries infact) of different lengths such as:
I need to find out the word coming after the word "FROM" in a shell script. For this I am able to find the location of word "FROM". How can I find out the word at a location = location of word "FROM" + 1 ?
Is there any better alternative for achieving purpose other than finding out locations of words?
TIA
Last edited by vgersh99; 09-14-2009 at 09:49 AM..
Reason: code tags, PLEASE!
How to use instr function in awk ?
to get the location
a) for example instr('productiondata_12','data',1) to get the location of data using awk.
b) for example instr('sampledata_rev_12','rev',1) to get the location of data
and reaplce with "org" using awk.
can anyone help
... (3 Replies)
eg .
i have file x.txt contains :
java coding , shell scriptting etc...
now i want to add "is langauge" after word java.
output should be
java is langauge coding , shell scriptting etc...
any idea how to use shell script to do it ? (10 Replies)
I'm a relative newbie and apologize if this is silly... Suppose I have a file with English words and their Spanish translations. I read them in like this:
while(getline < myfile > 0) {
eng = $1
SPAN = $2
}
Now, for every eng in SPAN, I want to scan through SPAN and search for a... (2 Replies)
Hi,
I am trying to develop a script which should find a word if a particular word exists.
Below is the content of the file.
insert_job: test_job ----> job name
days_of_week: all
start_times: "16:00"
date_conditions: 1
insert_job: test_job2 ----> job name
days_of_week: all... (16 Replies)
Hey guys,
I'm a new bee to this forum as well as to Unix, just having a requirement which i'm not sure how to write shell script for it..
Here is my requirement
This is related to tomcat catalina.out file. Just want to display the content of this file until it finds a word like 'server... (2 Replies)
I'm try to change a the prohibit to aix for the lines starting with ssh and emagent and rest should be the same. Can anyone please suggest me how to do that using a shell script or sed
passwd account required /usr/lib/security/pam_prohibit
passwd session required ... (13 Replies)
Hi friends,
I have one XML file having below structure :-
INput XML file :-
<?xml version="1.0" encoding="UTF-8"?>
<START>
<A=value1>
<attr name1="a1">
</A>
<B=value2>
<attr name2="b1">
<attr name3="c1">
</B>
</START>
output xml file should be
=== (3 Replies)
I have a big file having 100 K lines.
I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it.
There are two lines as one Header and one trailer which should remain same.
Can somebody... (5 Replies)
Hello All,
Since i'm relatively new in shell script need your guidance.
I'm copying files manually based on a specific word in a file name and its extension and then moving it into some destination folder.
so if filename contains hyr word and it has .md and .db extension; it will move to TUM/HYR... (13 Replies)
Discussion started by: prajaktaraut
13 Replies
LEARN ABOUT REDHAT
select_into
SELECT INTO(7) SQL Commands SELECT INTO(7)NAME
SELECT INTO - create a new table from the results of a query
SYNOPSIS
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
* | expression [ AS output_name ] [, ...]
INTO [ TEMPORARY | TEMP ] [ TABLE ] new_table
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ GROUP BY expression [, ...] ]
[ HAVING condition [, ...] ]
[ { UNION | INTERSECT | EXCEPT } [ ALL ] select ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
[ LIMIT { count | ALL } ]
[ OFFSET start ]
[ FOR UPDATE [ OF tablename [, ...] ] ]
INPUTS
TEMPORARY
TEMP If specified, the table is created as a temporary table. Refer to CREATE TABLE [create_table(7)] for details.
new_table
The name (optionally schema-qualified) of the table to be created.
All other inputs are described in detail for SELECT [select(7)].
OUTPUTS
Refer to CREATE TABLE [create_table(7)] and SELECT [select(7)] for a summary of possible output messages.
DESCRIPTION
SELECT INTO creates a new table and fills it with data computed by a query. The data is not returned to the client, as it is with a normal
SELECT. The new table's columns have the names and data types associated with the output columns of the SELECT.
Note: CREATE TABLE AS [create_table_as(7)] is functionally equivalent to SELECT INTO. CREATE TABLE AS is the recommended syntax,
since SELECT INTO is not standard. In fact, this form of SELECT INTO is not available in PL/pgSQL or ecpg(1), because they interpret
the INTO clause differently.
COMPATIBILITY
SQL92 uses SELECT ... INTO to represent selecting values into scalar variables of a host program, rather than creating a new table. This
indeed is the usage found in PL/pgSQL and ecpg(1). The PostgreSQL usage of SELECT INTO to represent table creation is historical. It's
best to use CREATE TABLE AS for this purpose in new code. (CREATE TABLE AS isn't standard either, but it's less likely to cause confu-
sion.)
SQL - Language Statements 2002-11-22 SELECT INTO(7)