extracting lines from a file with similar first name
consider i have two files
i am performing mainly 3 actions as given below..
the command (1) extracts individual view from onlyviews file to viewextract file respectively...
the command (2) checks whether a particular view is present in onlyviews2.sql or not.. that is viewpresent will be >1 if present or 0 if not
the command (3) deleted that particular view from onlyviews2.sql
now my problem is say variable $firstword has the contents as shown previously that is CREATE VIEW V11 so if i use commands it will consider V119 too in onlyviews2.sql... since "CREATE VIEW V11" is also present in ""CREATE VIEW V11"9".. so how to overcome this situation...?....
i want to extract lines 5 and 7 from a txt file which contains nearly 20 entries how to do it
also i want to check whether the 42nd character is 'S' in that line
suggestions welcome (4 Replies)
Hi!
I have a trouble with the sort and the uniq.
I know I have to use them, I just have trouble with putting them in the right order.
I have a text file with unsorted lines (each line has a few words, the first word in the line is a number.).
I need to sort this file in order to be... (6 Replies)
I have a log file "logreport" that contains several lines as seen below:
04:20:00 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
06:38:08 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
07:11:05 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead... (4 Replies)
I have a file which contains data as below:
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/common/index.jsf
nbk1j7o pageName=/jsp/common/index.jsf
nbk1wqe... (6 Replies)
Hello folks
I have a question for you gurus of sed or grep (maybe awk, but I would prefer the first two)
I have a file (f1) that says:
(actually, these are not numbers but md5sum, but for simplicity, let's assume these numbers.)
1
2
3
4
5And I have a file (f2) that says
1|a
1|b
1|c
2|d... (3 Replies)
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Hello! i have a text file.. which contains the data as follows
i want to merge the declarations lines pertaining to one datatype in to a single line as follows
i've searched the forum for help.. but couldn't find much help.. how can i do this?? (1 Reply)
Hi,
I have a file with the lines as below:
C_10_A05_T7
C_10_A06_SP6
C_10_B05_SP6
C_10_B05_T7
C_10_B01_SP6
C_10_B01_T7
C_12_G07_SP6
C_12_G11_SP6
C_12_G11_T7
C_2_H18_T7
C_2_I02_SP6
C_2_I02_T7
C_2_I13_SP6
C_2_I17_SP6
The four segments of each line are connected by '_' symbols. I... (7 Replies)
Hello,
I am a java programmer but want to try unix for a purpose where I need to reduce a file using its first field.. Here is the sample data:
admin;2;0;;
admission;8;0;;
aman;1;0;;
caroline;0;4;;
cook;0;4;;
cook;2;0;;
far;0;3;;
far;1;5;;
I am explaining the dataset first. There... (5 Replies)
Discussion started by: shekhar2010us
5 Replies
LEARN ABOUT CENTOS
create_schema
CREATE SCHEMA(7) PostgreSQL 9.2.7 Documentation CREATE SCHEMA(7)NAME
CREATE_SCHEMA - define a new schema
SYNOPSIS
CREATE SCHEMA schema_name [ AUTHORIZATION user_name ] [ schema_element [ ... ] ]
CREATE SCHEMA AUTHORIZATION user_name [ schema_element [ ... ] ]
DESCRIPTION
CREATE SCHEMA enters a new schema into the current database. The schema name must be distinct from the name of any existing schema in the
current database.
A schema is essentially a namespace: it contains named objects (tables, data types, functions, and operators) whose names can duplicate
those of other objects existing in other schemas. Named objects are accessed either by "qualifying" their names with the schema name as a
prefix, or by setting a search path that includes the desired schema(s). A CREATE command specifying an unqualified object name creates the
object in the current schema (the one at the front of the search path, which can be determined with the function current_schema).
Optionally, CREATE SCHEMA can include subcommands to create objects within the new schema. The subcommands are treated essentially the same
as separate commands issued after creating the schema, except that if the AUTHORIZATION clause is used, all the created objects will be
owned by that user.
PARAMETERS
schema_name
The name of a schema to be created. If this is omitted, the user_name is used as the schema name. The name cannot begin with pg_, as
such names are reserved for system schemas.
user_name
The role name of the user who will own the new schema. If omitted, defaults to the user executing the command. To create a schema owned
by another role, you must be a direct or indirect member of that role, or be a superuser.
schema_element
An SQL statement defining an object to be created within the schema. Currently, only CREATE TABLE, CREATE VIEW, CREATE INDEX, CREATE
SEQUENCE, CREATE TRIGGER and GRANT are accepted as clauses within CREATE SCHEMA. Other kinds of objects may be created in separate
commands after the schema is created.
NOTES
To create a schema, the invoking user must have the CREATE privilege for the current database. (Of course, superusers bypass this check.)
EXAMPLES
Create a schema:
CREATE SCHEMA myschema;
Create a schema for user joe; the schema will also be named joe:
CREATE SCHEMA AUTHORIZATION joe;
Create a schema and create a table and view within it:
CREATE SCHEMA hollywood
CREATE TABLE films (title text, release date, awards text[])
CREATE VIEW winners AS
SELECT title, release FROM films WHERE awards IS NOT NULL;
Notice that the individual subcommands do not end with semicolons.
The following is an equivalent way of accomplishing the same result:
CREATE SCHEMA hollywood;
CREATE TABLE hollywood.films (title text, release date, awards text[]);
CREATE VIEW hollywood.winners AS
SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;
COMPATIBILITY
The SQL standard allows a DEFAULT CHARACTER SET clause in CREATE SCHEMA, as well as more subcommand types than are presently accepted by
PostgreSQL.
The SQL standard specifies that the subcommands in CREATE SCHEMA can appear in any order. The present PostgreSQL implementation does not
handle all cases of forward references in subcommands; it might sometimes be necessary to reorder the subcommands in order to avoid forward
references.
According to the SQL standard, the owner of a schema always owns all objects within it. PostgreSQL allows schemas to contain objects owned
by users other than the schema owner. This can happen only if the schema owner grants the CREATE privilege on his schema to someone else,
or a superuser chooses to create objects in it.
SEE ALSO
ALTER SCHEMA (ALTER_SCHEMA(7)), DROP SCHEMA (DROP_SCHEMA(7))
PostgreSQL 9.2.7 2014-02-17 CREATE SCHEMA(7)